-
Notifications
You must be signed in to change notification settings - Fork 27.8k
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 was not caught ReferenceError: require is not defined with 7.0 #5238
Comments
Fixes the example with next.js@7 Fixes vercel#5238
I solved it by updating |
awesome, yeah I though graphql dependency was coming from react-apollo, but y that totally works tks 👍 cheers |
Fixes the example with next.js@7 Fixes #5238
* npm graphql requires to be update vercel/next.js#5238 (comment)
We had exactly same issue, and upgrading graphql version didn't help (at first), so we spent quite some time investigating, until we've found that one of the dependency of our dependency had it's own copy of In case anybody else would be struggling with the same issue. |
* Upgrade all dependencies 1. ncu --upgradeAll 4. Leave "graphql" to be "^13.2.0" that apollo packages depend on 2. Apply patch of "npx babel-upgrade" output 3. Leave only necessary babel plugins 4. Pass "yarn fix" by disabling stricter rules * Pass "req" through GraphQL resolver context * Through rootValue it cannot be passed from browser GraphQL access * rm unnecessary code * Add "Timestamp" scalar type for convinience * rm unnecessary files * fix: Timestamp didn't work * npm graphql requires to be update vercel/next.js#5238 (comment) * Feature: Codegen from GraphQL schema and use more Flow types (#2) * install apllo * add apollo.config.js * apollo codegen succeeded * fix: updateNetworkStatus signature * rm @flow from files not ready * add flow-typed files * done: Using auto-generated types works * [email protected]+ has regression. Use ^0.88.0. * fix: invalid GraphQL primitive types * Add codegen script * done: import auto-generated file * refac: move impl for apollo-link-state to graphql dir as same as server side resolvers * codegen and ignore eslint these files * refactor: "networkStatus" * feat: codegen:standalone * refac: "OnMemoryState" is what I meant * Improve codegen (#3) * delete existing auto-generated types * change script name * ignore __generated__ folder * wip: disallow absolute path resolving under `src` dir * It causes disregard .js type checking under src * fix all flow error * modify: prevent `withStyles` drops component type * Modify targe Node versions * Fix build failure: Codegen before lint * Add Node v10 LTS for build target
I don't have graphql but still I get the error |
Examples bug report
Example name
With apollo
Describe the bug
VM64:37 Error was not caught ReferenceError: require is not defined
at Module../node_modules/graphql/jsutils/instanceOf.mjs (instanceOf.mjs:31)
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
I can imagine other apollo examples also have the same issue after 7.x
Expected behavior
No errors.
Screenshots
System information
Additional context
Only happens when trying out 7.0. It seems related to webpack4 and the support on .mjs files..it could be also an issue with graphql-js, I cant really find anything there. maybe someone else can help finding this out..will gladly move issue there if thats the case. Also dont know if at this point 7.0 is stable..just wanted to see how bad an upgrade would be, probably still a bit soon for me ;)
The text was updated successfully, but these errors were encountered: