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

SyntaxError: Expected double-quoted property name in JSON at position 959 #36

Open
marcguillemdev opened this issue Jan 18, 2024 · 3 comments

Comments

@marcguillemdev
Copy link

The following error is displayed when executing the i18n:extract command:

  • An error occurred: SyntaxError: Expected double-quoted property name in JSON at position 959.

I have been checking different files until I found the cause and it is the following class:

import { MatPaginatorIntl } from '@angular/material/paginator';

export class PaginatorIntl implements MatPaginatorIntl {

}

If I import the class "MatPaginatorIntl" and implement it as in the example above, the error is displayed. If I remove the import or do not implement it the error disappears. I don't know why this is happening, maybe the JSON compiler is misinterpreting the file or I don't know what could be going on.

To reproduce the error just run the following command on the above class:
ngx-translate-extract --input ./paginator-intl.ts --output ./src/assets/i18n/error_reproduce.json --clean --format json

Angular version: 16
ngx-translate version-extract: 8.3.0

@pmpak
Copy link

pmpak commented Jan 21, 2024

This might be the same as #24 which was addressed in #30. Since you are using Angular 16, could you try installing v8.2.1 and see if that works?

@marcguillemdev
Copy link
Author

@pmpak thanks for your response. It works with version 8.2.1, but why doesn't it work on the latest version 8.3.0? In the readme it clearly says that we need v8x for Angular 13 to 16, that's why I chose the latest v8.

@michaelbromley
Copy link
Member

Hi @pmpak, I guess there was a regression introduced somewhere between 8.2.1 -> 8.3.0? If 8.2.1 is working for you, I'd advise to just stick with that.

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