-
-
Notifications
You must be signed in to change notification settings - Fork 529
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 in the browser console when -> import { setupWorker } from 'msw' #1645
Comments
I was normally using this library in my project and when I update the dependencies it starts giving me this error. I would be very grateful if it could be solved |
Duplicate of #1643 |
Thanks for your reply. I am not using the graphql-js library. In any case, I have installed it with version v16.7.1 and the problem persists. Iam missing something to do? Greetings |
Unfortunately even if you don't use graphql, it's bundled in the msw library anyways. That line comes from the graphql-js package, and the issue was supposedly fixed in this very version, but if you are still experiencing this issue it might not be fully fixed and should probably be reported directly in the graphql-js repo. Can you share a minimal public repo to replicate the bug? |
Hi, I have prepared a small demo modifying my project, from here you can see the error. 1- Clone or download the project 2- run npm i 3- run npm run dev Demo: Thanks a lot |
Thank you, this has been reported on graphql/graphql-js#3918 and happens because of graphql/graphql-js#3925. There is already a Pull Request pending graphql/graphql-js#3927 that should fix the issue, at this point the only thing to do is to downgrade graphql to v16.6.0 or wait for a patch release. |
Thank you very much for your quick response. I will be using version 16.6.0 until the bug is fixed. Very thankful. |
Thanks for reporting this! As stated above, the issue seems to be caused by a transient dependency of MSW—the |
Installed graphql 16.6.0 but the issue still remains EDIT: upgraded to 16.7.1 as well as 16.8.0, still getting the same issue |
The problem is not solved. I tried different versions of graphql - the error persists. |
graphql/graphql-js#3918 (comment) this issue lies in graphql-js, and there's not much we can do about it here, but using
|
I use quasar 2 and It didn't help... /* eslint-env node */
const replace = require('@rollup/plugin-replace')
const { configure } = require('quasar/wrappers')
const path = require('path')
module.exports = configure(function(/* ctx */) {
return {
// default settings
build: {
// other settings
plugins: [
replace({
preventAssignment: true,
'globalThis.development': JSON.stringify(process.env.NODE_ENV),
// or
'globalThis.process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
}),
]
},
// other settings
}
}) |
I've never heard of quasar, but a quick search of issues in quasar shows
|
Prerequisites
Environment check
msw
versionNode.js version
v19.7.0
Reproduction repository
no exists
Reproduction steps
Just import this library
import { setupWorker } from 'msw'
Current behavior
In the chrome console show this error:
msw.js?v=fae9f746:6010 Uncaught SyntaxError: Unexpected string
The error line is:
Expected behavior
Load the library normally
The text was updated successfully, but these errors were encountered: