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

Adds better error messages for unparsable babel files: #2175

Merged
merged 2 commits into from
Feb 18, 2022

Conversation

orta
Copy link
Member

@orta orta commented Feb 18, 2022

I've had vscode-graphql be un-usable for a few days because I have no idea which file is doing this on load:

[Info  - 4:06:51 PM] Connection to server got closed. Server will restart.
[Info  - 4:06:51 PM] The graphql server has stopped running
[Info  - 4:06:51 PM] The graphql server has stopped running
2/16/2022, 4:06:51 PM [3] (pid: 57218) graphql-language-service-usage-logs: {"type":"usage","messageType":"initialize"}
/Users/ortatherox/.vscode-insiders/extensions/graphql.vscode-graphql-0.3.50/out/server/server.js:99551
        const err = new SyntaxError(message);
                    ^

SyntaxError: Unexpected token, expected "," (21:7)
    at Object._raise (/Users/ortatherox/.vscode-insiders/extensions/graphql.vscode-graphql-0.3.50/out/server/server.js:99551:21)
    at Object.raiseWithData (/Users/ortatherox/.vscode-insiders/extensions/graphql.vscode-graphql-0.3.50/out/server/server.js:99545:21)
    at Object.raise (/Users/ortatherox/.vscode-insiders/extensions/graphql.vscode-graphql-0.3.50/out/server/server.js:99512:21)
    at Object.unexpected (/Users/ortatherox/.vscode-insiders/extensions/graphql.vscode-graphql-0.3.50/out/server/server.js:102147:20)
    at Object.expect (/Users/ortatherox/.vscode-insiders/extensions/graphql.vscode-graphql-0.3.50/out/server/server.js:102124:32)
    at Object.parseObjectLike (/Users/ortatherox/.vscode-insiders/extensions/graphql.vscode-graphql-0.3.50/out/server/server.js:109414:18)
    at Object.parseExprAtom (/Users/ortatherox/.vscode-insiders/extensions/graphql.vscode-graphql-0.3.50/out/server/server.js:108971:25)
    at Object.parseExprAtom (/Users/ortatherox/.vscode-insiders/extensions/graphql.vscode-graphql-0.3.50/out/server/server.js:105392:24)
    at Object.parseExprSubscripts (/Users/ortatherox/.vscode-insiders/extensions/graphql.vscode-graphql-0.3.50/out/server/server.js:108718:27)
    at Object.parseUpdate (/Users/ortatherox/.vscode-insiders/extensions/graphql.vscode-graphql-0.3.50/out/server/server.js:108700:25) {
  loc: Position { line: 21, column: 7 },
  pos: 716,
  code: 'BABEL_PARSER_SYNTAX_ERROR',
  reasonCode: 'UnexpectedToken'
}
[Error - 4:06:51 PM] Connection to server got closed. Server will not be restarted.
[Info  - 4:06:51 PM] The graphql server has stopped running

Now it would load up, give a few logger error messages and not throw 👍🏻

@changeset-bot
Copy link

changeset-bot bot commented Feb 18, 2022

⚠️ No Changeset found

Latest commit: 35a08a5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@codecov
Copy link

codecov bot commented Feb 18, 2022

Codecov Report

Merging #2175 (35a08a5) into main (2d91916) will decrease coverage by 0.85%.
The diff coverage is 77.98%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2175      +/-   ##
==========================================
- Coverage   65.70%   64.85%   -0.86%     
==========================================
  Files          85       77       -8     
  Lines        5106     5195      +89     
  Branches     1631     1658      +27     
==========================================
+ Hits         3355     3369      +14     
- Misses       1747     1822      +75     
  Partials        4        4              
Impacted Files Coverage Δ
packages/codemirror-graphql/src/hint.ts 94.73% <ø> (ø)
packages/codemirror-graphql/src/lint.ts 100.00% <ø> (ø)
packages/codemirror-graphql/src/results/mode.ts 47.05% <ø> (ø)
...kages/codemirror-graphql/src/utils/forEachState.ts 100.00% <ø> (ø)
...ckages/codemirror-graphql/src/utils/mode-indent.ts 0.00% <0.00%> (ø)
packages/codemirror-graphql/src/variables/hint.ts 89.70% <ø> (ø)
packages/codemirror-graphql/src/variables/mode.ts 79.48% <ø> (ø)
packages/graphiql/src/components/QueryEditor.tsx 63.96% <ø> (ø)
packages/graphiql/src/utility/fillLeafs.ts 5.33% <ø> (ø)
...kages/graphiql/src/utility/introspectionQueries.ts 100.00% <ø> (ø)
... and 56 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d3b1540...35a08a5. Read the comment docs.

@acao acao merged commit 48c5df6 into graphql:main Feb 18, 2022
@github-actions github-actions bot mentioned this pull request Feb 18, 2022
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

Successfully merging this pull request may close these issues.

None yet

2 participants