graphiql icon indicating copy to clipboard operation
graphiql copied to clipboard

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

Open cwoolum opened this issue 1 year ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

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

  • GraphiQL Version: 3.1.0
  • OS: Linux
  • Browser: N/A
  • Bundler: ESBuild
  • react Version: N/A
  • graphql Version: 3.1.0

Anything else?

No response

cwoolum avatar Apr 12 '24 19:04 cwoolum

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

ethan-tam33 avatar Jul 02 '24 20:07 ethan-tam33

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.

ethan-tam33 avatar Jul 02 '24 21:07 ethan-tam33