Closed brendenpalmer closed 9 months ago
As part of the @urql/next bundle React exports are incorrectly called via React["default"], rather than the top-level React object.
@urql/next
React["default"]
React
For instance, see the @urql/next CommonJS bundle: https://www.unpkg.com/@urql/next@1.0.0/dist/urql-next.js vs. the regular urql bundle here: https://www.unpkg.com/urql@4.0.5/dist/urql.js (see the differences in createContext usages as an example).
urql
createContext
When using @urql/next and testing with Jest this breaks in tests with the following error: TypeError: Cannot read properties of undefined (reading 'createContext').
TypeError: Cannot read properties of undefined (reading 'createContext')
To reproduce:
npm install
npm run test
https://github.com/brendenpalmer/next-urql-commonjs-issue-repro
@urql/next 1.0.0
Got the same issue here 🥲
Describe the bug
As part of the
@urql/next
bundle React exports are incorrectly called viaReact["default"]
, rather than the top-levelReact
object.For instance, see the
@urql/next
CommonJS bundle: https://www.unpkg.com/@urql/next@1.0.0/dist/urql-next.js vs. the regularurql
bundle here: https://www.unpkg.com/urql@4.0.5/dist/urql.js (see the differences increateContext
usages as an example).When using
@urql/next
and testing with Jest this breaks in tests with the following error:TypeError: Cannot read properties of undefined (reading 'createContext')
.To reproduce:
npm install
npm run test
Reproduction
https://github.com/brendenpalmer/next-urql-commonjs-issue-repro
Urql version
@urql/next
1.0.0Validations