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

Unexpected token ] in JSON at position 719 #8

Closed
Joniras opened this issue Mar 4, 2019 · 5 comments
Closed

Unexpected token ] in JSON at position 719 #8

Joniras opened this issue Mar 4, 2019 · 5 comments

Comments

@Joniras
Copy link

Joniras commented Mar 4, 2019

Executing one of the example commands:
ng g ngx-spec:spec '**/*'

gives only me the following (and does not do anything):

Unexpected token ] in JSON at position 719

Either the package is broken or i have a configuration error i cannot find.

Also, the error message doesnt really help.

(All my dependencies are up to date)

@smnbbrv
Copy link
Owner

smnbbrv commented Mar 4, 2019

you are totally right, the error message is shitty (that's one that comes from @angular/cli)

Please try to change ngx-spec:spec to ngx-spec:specs. My fault, I wrongly documented it in the README => just fixed that.

ng g ngx-spec:specs '**/*'

@Joniras
Copy link
Author

Joniras commented Mar 4, 2019

The error is still here.

Same error although changed the command to:
ng g ngx-spec:specs '**/*'

@smnbbrv
Copy link
Owner

smnbbrv commented Mar 4, 2019

could you please share OS that you have and the versions of those packages

  • @angular-devkit/core
  • @angular-devkit/schematics
  • @schematics/angular

?

@Joniras
Copy link
Author

Joniras commented Mar 4, 2019

Alright, that was my fault, i had a trailing comma in angular.json
(angular itself didnt bother).

Issue solved (if there cant be anything done to make the error message more obvious).

Thanks for the support though.

@smnbbrv
Copy link
Owner

smnbbrv commented Mar 4, 2019

wow, the error is really weird.

This library is just a function which is called by angular cli. You type

ng g ...

and this actually is that angular cli generates something. Then the lib is that something, or, more correct, lib says how to do it.

This error message comes from angular cli because it could not parse your file. If you return this comma in place and try to generate another component, directive or whatsoever it would result into the same error.

I hope this clarifies the root of the error and how it all works (a bit).

If the issue is solved, could you close it, please?

@Joniras Joniras closed this as completed Mar 4, 2019
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

2 participants