-
Notifications
You must be signed in to change notification settings - Fork 26.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
Cannot use Apollo GraphQL with new _middleware API #31694
Comments
Reproduced in this repository: https://github.com/ncphillips/reproduce-apollo-middleware-build-failure |
This seems to be expected as the library is using |
big oof |
Would there by any way to disable that requirement? It's unclear to me why it's needed for |
_middleware runs in a new environment that does not allow for eval. This ensures that any new code written is compatible with the standard web apis which will allow executing them in Workers and even in the browser in development, it's a preparation for future work to improve more of the Next.js rendering cycle and where code can run. |
Very interesting. I'll open a ticket with apollo later. Thanks Tim |
@timneutkens I opened a ticket in Apollo (apollographql/apollo-client#9128) and they're wondering if this is an issue with how the check happening in Next.js. I went and looked at one of the files that Next.js was complaining about and there's no instances of Edit: I've pulled down the apollo-client source code. I cannot find any references to |
Woo! The issue has been discovered and the fixes are incoming on the apollo side! |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
What version of Next.js are you using?
12.0.4
What version of Node.js are you using?
16.9.0
What browser are you using?
n/a
What operating system are you using?
macOS
How are you deploying your application?
n/a
Describe the Bug
Inside of
pages/_middleware
I initialize a new instance ofApolloClient
withcreateHttpLink
in@apollo/client
.When I try to run
next build
it fails:Expected Behavior
Build succeeds
To Reproduce
I will provide a reproduction if necessary.
The text was updated successfully, but these errors were encountered: