graphql / graphiql

GraphiQL & the GraphQL LSP Reference Ecosystem for building browser & IDE tools.
MIT License
16.12k stars 1.73k forks source link

[graphiql] Upgrade to @graphiql/react breaks unit tests #3581

Open cwoolum opened 7 months ago

cwoolum commented 7 months ago

Is there an existing issue for this?

Current Behavior

We are getting the error

TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them
 - /local/myproject/node_modules/@graphiql/react/src/utility/context.ts:24:58
 - /local/myproject/node_modules/@graphiql/plugin-explorer/dist/index.js:1:2531
 - /local/myproject/node_modules/react-dom/cjs/react-dom.development.js:16305:18
 - /local/myproject/node_modules/react-dom/cjs/react-dom.development.js:20074:13
 - /local/myproject/node_modules/react-dom/cjs/react-dom.development.js:21587:16
 - /local/myproject/node_modules/react-dom/cjs/react-dom.development.js:4164:14
 - /local/myproject/node_modules/happy-dom/src/event/EventTarget.ts:223:42
 - /local/myproject/node_modules/happy-dom/src/nodes/element/Element.ts:1171:29
 - /local/myproject/node_modules/happy-dom/src/event/EventTarget.ts:132:9
 - /local/myproject/node_modules/happy-dom/src/nodes/element/Element.ts:1171:29

We had previously been using

"@graphiql/plugin-explorer": "1.0.3",
"graphiql": "3.1.0",

Upon upgrading our packages, @graphiql/plugin-explorer upgraded to 1.0.4 and @graphiql/react to 0.20.4, the above error started occurring.

Expected Behavior

Out tests were previously been passing so I would expect them to continue with no changes

Steps To Reproduce

Open this environment

https://stackblitz.com/edit/vitejs-vite-kkpoqd?file=vite.config.ts

Run npx vitest.

Environment

Anything else?

No response

ethan-tam33 commented 4 months ago

Hi, did you ever resolve this issue? What versions of graphiql/react, graphiql, and graphiql/plugin-explorer don't cause this issue?

ethan-tam33 commented 4 months ago

Oops never mind! Just use the versions of graphiql and graphiql/plugin-explorer above and upgrade graphiql/react to 0.22.4. That worked for me.