question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

upgrading to 14.0.2 - .tsx: Unexpected token, expected "}"

See original GitHub issue

Hi, after upgrading to 14.0.2 I get this error when i run the command gql-gen, but the typescript is perfectly valid. :S

> gql-gen

  √ Parse configuration
  > Generate outputs
    > Generate src/app/shared/models/graphql/types.ts
      √ Load GraphQL schemas
      × Load GraphQL documents
        →   35 |       ],
        Generate
    √ Generate src/app/shared/models/graphql/services.ts


     We found 1 errors

     Failed to generate src/app/shared/models/graphql/types.ts
SyntaxError: C:\Users\<username>\source\repos\<projectname>\MyProject.Web\.tsx: Unexpected token, expected "}" (32:14)

30 |   static forRoot(): ModuleWithProviders {
31 |     return <ModuleWithProviders>{
> 32 |       ngModule: CoreModule,
    |               ^
33 |       providers: [
34 |         ...NB_CORE_PROVIDERS,
35 |       ],

codegen.yml

schema:
  - 'schema.json'
overwrite: true
config:
  avoidOptionals: false
generates:
  src/app/shared/models/graphql/types.ts:
    documents:
      - './src/app/**/*.ts'
    plugins:
      - 'typescript-common'
      - 'typescript-client'
      - 'typescript-server'
  src/app/shared/models/graphql/services.ts:
    documents:
      - './src/app/**/*.gql'
    plugins:
      - 'typescript-common'
      - 'typescript-client'
      - 'typescript-apollo-angular'

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14

github_iconTop GitHub Comments

1reaction
kamilkisielacommented, Nov 26, 2018

We changed the way we extract documents from ts and js files. Before that we used RegExp, now we use the library that our teammate wrote. It uses AST to find stuff based on the default export of graphql-tag.

I’ll release a v0.14.4 soon.

0reactions
kamilkisielacommented, Dec 13, 2018

Released in v0.15.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix Parsing error: Unexpected token, expected "," in ...
I found the issue by cloning into your repo. It is with "parser": "babel" in eslint.rc prettier/prettier . Use "parser": "babel-ts" or ...
Read more >
unexpected token, expected "," jest - You.com | The AI Search ...
It appears to me that there is an issue in the package you're using. It's trying to use ES modules syntax (import /...
Read more >
'Unexpected token' error - Upgrade from QV 11.2 to... - 14052
'Unexpected token' error - Upgrade from QV 11.2 to November 2017 SR3. After upgrading, one document (No changes) keeps failing while running.
Read more >
15 - Line 35:9: Parsing error: Unexpected token, expected ...
Parsing error: Unexpected token, expected "," Error Solved in React You could not pass two values in return.Watch Full Part of Video ...
Read more >
[Solved] Argh... Unexpected token, expected "}"
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found