You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When bundling graphql-js with webpack, e.g. as dependency of graphiql, you get this error at runtime:
ReferenceError: require is not defined
at Module.../sourcegraph/node_modules/graphql/jsutils/instanceOf.mjs (instanceOf.mjs:28)
at __webpack_require__ (bootstrap:63)
at Module.../sourcegraph/node_modules/graphql/type/definition.mjs (definition.mjs:1)
at __webpack_require__ (bootstrap:63)
at Module.../sourcegraph/node_modules/graphql/type/validate.mjs (validate.mjs:1)
at __webpack_require__ (bootstrap:63)
at Module.../sourcegraph/node_modules/graphql/graphql.mjs (graphql.mjs:1)
at __webpack_require__ (bootstrap:63)
at Module.../sourcegraph/node_modules/graphql/index.mjs (index.mjs:2)
at __webpack_require__ (bootstrap:63)
In the ESM build, which is used by webpack by following the module field in package.json, the file gets compiled to a .mjs file, which does not get applied the webpack ProvidePlugin, see webpack/webpack#7032.
This makes it impossible to bundle graphiql with webpack.
ryanwiesjahn, alexandercarls, tomeightyeight and six7