-
-
Notifications
You must be signed in to change notification settings - Fork 533
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
GraphQL version >=16.7.0 throws exceptions about Unexpected string #1655
Comments
issue with graphql seems to be affecting other tools as well graphql/graphql-js#3928 and graphql/graphql-js#3925 |
Any updates on this? |
I opened a PR with a fix that pins the graphql dependency to last working version before the breaking change. |
Sad to hear that, let's hope this get merged soon |
I left a comment on the pnpm version mismatch that prevents me from merging this fix. Please see. Thanks. |
I genuinely wonder why you aren't getting the latest |
Tried it, but I'm starting to suspect that is some kind of issue with NX (I just moved the project to a monorepo). So will keep looking for a solution. |
Sometimes a package manager will skip installing a more recent version if the local one matches the semver range. Deleting |
yeah that's where the issue was, with that's been 3 weeks ago, don't know if graphql fixed the issue on their end since then but by looking at the issues i linked in my previous comment i assume the issue is still present |
@bartektelec Just tried with resolutions option in package json and with 16.6.0 it worked!. Cannot say the same about 16.7.0 and 16.7.1 :( @kettanaito Thanks both for help! |
@kettanaito should be good now |
Yes, the GraphQL maintainers have fixed the issue since. There was a bug in the compiler, as I understand, that evaluated the correct source code incorrectly, shipping an expression that would break on runtime when consumed. I don't mind explicitly pinning the |
is your project using a bundler like vite or rollup? Could you check what version you are running? I think I narrowed down the issue to be solved when using vite version higher or equal |
I'm getting the same error today, fresh install, don't have graphql installed separately. Looking in package-lock shows msw has the
And I have 16.8.0 resolved:
|
If this is a problem with |
Hey @andyjessop If for some reason you are bound to a lower version of vite, you can change the |
Updating to vite >=4.2 solves the issue however I need Vite to be 4.1. Is there a way to lock the upper graphql version resolved by msw from the package.json file instead of manually editing the lock file? |
@asantTMC https://docs.npmjs.com/cli/v8/configuring-npm/package-json#overrides |
Can confirm that using ovverides or resolutions prevent msw to depend on the graphql 16.8 version thus solving the issue |
Released: v1.3.2 🎉This has been released in v1.3.2! Make sure to always update to the latest version ( Predictable release automation by @ossjs/release. |
I recently upgraded
|
Prerequisites
Environment check
msw
versionBrowsers
Chromium (Chrome, Brave, etc.)
Reproduction repository
CodeSandbox link
Reproduction steps
Install any kind of msw version - i have only tested versions newer than 1.0.1
yarn dev
Unexpected string
and firefox throws aboutmissing name after . operator
Screenshot:
It looks like the graphql maintainers already know about this issue as there is a FIXME comment with an issue linked to it on the exact place where it breaks
Current behavior
It took me some digging. since graphql introduced some breaking changes when bumping up the minor version and msw depends on
"graphql": "^15.0.0 || ^16.0.0",
Without a lock file, npm will by default install
16.7.1
as it's peer dependency. Bothgraphql
versions16.7.0
and16.7.1
will cause this problem.If you have a lock file that points to an older version of graphql as msw's dependency like
16.6.0
it will work just fine.Expected behavior
MSW should lock its graphql dependency to not include the
16.7.x
versions until stableThe text was updated successfully, but these errors were encountered: