Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for angular 9 #46

Open
filipefreitas82 opened this issue Feb 17, 2020 · 3 comments
Open

Support for angular 9 #46

filipefreitas82 opened this issue Feb 17, 2020 · 3 comments

Comments

@filipefreitas82
Copy link

After updating angular to version 9 we get this error:

ERROR in node_modules/json-typescript-mapper/index.ts:187:13 - error TS2536: Type 'string' cannot be used to index type 'T'.

187 instance[key] = decoratorMetaData.customConverter.fromJson(json[decoratorMetaData.name || key]);

@decline
Copy link

decline commented Feb 21, 2020

This is because Angular 9 now requires a higher typescript version. I also faced this error when I migrated Angular to the latest 8.2 version.

Setting typescript back from "typescript": "~3.5.3" to "typescript": "~3.4.5" fixed it for me, but of course this is not a long-term solution...

I think about abandoning the json-typescript-mapper package completely since it doesn't seem to be maintained anymore 🙁

@filipefreitas82
Copy link
Author

@decline
For us downgrading typescript is not an option since angular 9 doesn't support those versions.
We ended up forking this package and fixed the compile error. The solution is far from ideal because we lost the class mapping in some cases.

@jonghshin
Copy link

I'm having the same issue, and this is not fixed yet.
I'm using Angular 10.

OspinaOcampo added a commit to OspinaOcampo/json-typescript-mapper that referenced this issue Jan 10, 2023
Fix issue "Support for angular 9" (jf3096#46)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants