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

Error after upgrading to graphql 16.7.0: "Uncaught SyntaxError: Unexpected string" #1643

Closed
4 tasks done
oidualc opened this issue Jun 22, 2023 · 10 comments
Closed
4 tasks done
Labels
bug Something isn't working needs:triage Issues that have not been investigated yet. scope:browser Related to MSW running in a browser

Comments

@oidualc
Copy link

oidualc commented Jun 22, 2023

Prerequisites

Environment check

  • I'm using the latest msw version
  • I'm using Node.js version 14 or higher

Browsers

Chromium (Chrome, Brave, etc.)

Reproduction repository

https://github.com/oidualc/msw-graphql-issue

Reproduction steps

Current behavior

Blank page and error on console Uncaught SyntaxError: Unexpected string.
This happens since upgrading graphql to 16.7.0, does not happen forcing the version to 16.6.0.

Expected behavior

Page rendered correctly, no errors on console.

@oidualc oidualc added bug Something isn't working needs:triage Issues that have not been investigated yet. scope:browser Related to MSW running in a browser labels Jun 22, 2023
@SwagMuffinMcYoloPants
Copy link

I get the same issue too. When i roll back to msw 0.40.2, it seems to work again.

@oidualc
Copy link
Author

oidualc commented Jun 22, 2023

@SwagMuffinMcYoloPants
Copy link

@oidualc I'm using REST and it's exhibiting the same problem. I can make a repo if you want.

@thepassle
Copy link
Contributor

Repo wont be needed, but thank you for offering :) The issue has already been identified, waiting for action on the side of the graphql maintainers.

@SwagMuffinMcYoloPants
Copy link

ah, but the issue I'm seeing the issue with REST and would it be caused by the same issue? Or is it something completely different?

@oidualc
Copy link
Author

oidualc commented Jun 22, 2023

Closing the issue as it was resolved upstream with graphql/graphql-js#3923. For future reference for anyone who will encounter this bug, just make sure to upgrade the graphql sub-dependency at least to https://github.com/graphql/graphql-js/releases/tag/v16.7.1.

@EhabSalah
Copy link

This could be an error introduced with version 16.7.0 of the graphql package. Please downgrade for 16.6.0 for now, we are looking into this.

@kristojorg
Copy link

@oidualc , is a newer version of graphql installed in msw? I just tried on latest and was still seeing this error. I don't believe npm provides a way (like yarn resolutions) to upgrade a sub-dependency. I tried installing latest graphql and this did not resolve the problem

@integratorivan
Copy link

@kristojorg hello! I have updated vite to the latest version (3.0.7 -> 4.4.7) and am updating msw - and the problem is solved

check this issue #1655

@kristojorg
Copy link

Thank you @integratorivan ! I'll give it a try : )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs:triage Issues that have not been investigated yet. scope:browser Related to MSW running in a browser
Projects
None yet
Development

No branches or pull requests

6 participants