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.

I don't know error in which line from error message

See original GitHub issue

package version: 0.18.1

[ graphql-let ] Processing 2 codegen...
[ graphql-let ] Syntax Error: Expected Name, found "}".
GraphQLError: Syntax Error: Expected Name, found "}".
    at syntaxError (/Applications/myspace/projects/writa-next/node_modules/graphql/error/syntaxError.js:15:10)
    at Parser.expectToken (/Applications/myspace/projects/writa-next/node_modules/graphql/language/parser.js:1413:40)
    at Parser.parseName (/Applications/myspace/projects/writa-next/node_modules/graphql/language/parser.js:98:22)
    at Parser.parseField (/Applications/myspace/projects/writa-next/node_modules/graphql/language/parser.js:295:28)
    at Parser.parseSelection (/Applications/myspace/projects/writa-next/node_modules/graphql/language/parser.js:284:81)
    at Parser.many (/Applications/myspace/projects/writa-next/node_modules/graphql/language/parser.js:1523:26)
    at Parser.parseSelectionSet (/Applications/myspace/projects/writa-next/node_modules/graphql/language/parser.js:271:24)
    at Parser.parseOperationDefinition (/Applications/myspace/projects/writa-next/node_modules/graphql/language/parser.js:199:26)
    at Parser.parseDefinition (/Applications/myspace/projects/writa-next/node_modules/graphql/language/parser.js:137:23)
    at Parser.many (/Applications/myspace/projects/writa-next/node_modules/graphql/language/parser.js:1523:26)
[ graphql-let ] Something went wrong
ListrError: Something went wrong
    at /Applications/myspace/projects/writa-next/node_modules/listr/index.js:102:18
    at async executeCodegen (/Applications/myspace/projects/writa-next/node_modules/@graphql-codegen/cli/index.cjs.js:917:5)
    at async Object.generate (/Applications/myspace/projects/writa-next/node_modules/@graphql-codegen/cli/index.cjs.js:1214:25)
    at async processGraphQLCodegen (/Applications/myspace/projects/writa-next/node_modules/graphql-let/dist/lib/codegen.js:139:19)
    at async Object.processCodegenForContext (/Applications/myspace/projects/writa-next/node_modules/graphql-let/dist/lib/codegen.js:169:12)
    at async gen (/Applications/myspace/projects/writa-next/node_modules/graphql-let/dist/gen.js:82:9)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
piglovesyoucommented, Jun 5, 2021

v0.18.1 out

[ graphql-let ] Syntax Error: Expected "$", found Name "currency".
GraphQLError: Syntax Error: Expected "$", found Name "currency".
    at syntaxError (/xxx/node_modules/graphql/error/syntaxError.js:15:10)
...

v0.18.2 will out:

[ graphql-let ] /xxx/src/App.tsx; Syntax Error: Expected "$", found Name "currency".
In line 2, column 11 of the following source:
  query 
    rates(currency: "USD") {
      ...Partial
    }
  }

    at syntaxError (/xxx/node_modules/graphql/error/syntaxError.js:15:10)

0reactions
piglovesyoucommented, Jun 12, 2021

v0.18.4 must print the exact wrong line like this. I’ve missed e.toString() API of GraphQLError😣

[ graphql-let ] Syntax Error: Expected Name, found "}".

/path/to/pages/viewer.graphql:7:1
6 | query Viewerx {
7 | }
  | ^
8 |
GraphQLError: Syntax Error: Expected Name, found "}".
    at syntaxError (/path/to/node_modules/graphql/error/syntaxError.js:15:10)
    at Parser.expectToken (/path/to/node_modules/graphql/language/parser.js:1413:40)
    at Parser.parseName (/path/to/node_modules/graphql/language/parser.js:98:22)
    at Parser.parseField (/path/to/node_modules/graphql/language/parser.js:295:28)
    at Parser.parseSelection (/path/to/node_modules/graphql/language/parser.js:284:81)
    at Parser.many (/path/to/node_modules/graphql/language/parser.js:1523:26)
    at Parser.parseSelectionSet (/path/to/node_modules/graphql/language/parser.js:271:24)
    at Parser.parseOperationDefinition (/path/to/node_modules/graphql/language/parser.js:199:26)
    at Parser.parseDefinition (/path/to/node_modules/graphql/language/parser.js:137:23)
    at Parser.many (/path/to/node_modules/graphql/language/parser.js:1523:26)
[ graphql-let ] ListrError: Something went wrong
ListrError: Something went wrong
    at /path/to/node_modules/listr/index.js:102:18
    at async executeCodegen (/path/to/node_modules/@graphql-codegen/cli/index.cjs.js:884:5)
    at async Object.generate (/path/to/node_modules/@graphql-codegen/cli/index.cjs.js:1181:25)
    at async processGraphQLCodegen (/path/to/node_modules/graphql-let/dist/lib/codegen.js:140:19)
    at async Object.processCodegenForContext (/path/to/node_modules/graphql-let/dist/lib/codegen.js:168:12)
    at async gen (/path/to/node_modules/graphql-let/dist/gen.js:82:9)
Read more comments on GitHub >

github_iconTop Results From Across the Web

When I catch an exception, how do I get the type, file, and line ...
To sum it, I created a page to show errors. Return this on exception. context={ 'details':'Type of error:{}:Function name:{}: ...
Read more >
How to find the error line - MSDN - Microsoft
To find out where the error occurs, you could "open the call stack (Debug > Window > Call Stack) to see what functions...
Read more >
8. Errors and Exceptions — Python 3.11.1 documentation
The last line of the error message indicates what happened. Exceptions come in different types, and the type is printed as part of...
Read more >
How to implement error handling in SQL Server - SQLShack
ERROR_LINE – Returns the line number at which an error happened on. ERROR_PROCEDURE – Returns the name of the stored procedure or function. ......
Read more >
Python errors and exceptions
Here, Python tells us that there is a SyntaxError on line 1, and even puts a little arrow in the place where there...
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