-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
@apollo/client is crashing trying to render an ApolloProvider with client in React & Typescript #7370
Comments
Fixes the Symbol-related errors reported in #7370.
@Billy- I very much share your surprise that the problems with source maps have not been reported by anyone else. Presumably everyone else just assumed we don't ship source maps and went on with their days. Anyway, that problem will be fixed in As for the |
Hey @benjamn - I'm actually having the same problem where the @Billy- resolve:
My resolve:
Do you have any recommendation for how to resolve this? |
I tried updating to @apollo/client@3.4.0-beta.2, seeing that you made changes to this import in #7371 and now React is undefined within that file, so I'm getting very similar errors after the attempted fixes.
|
@apollo/client
is crashing trying to render anApolloProvider
withclient
in React & Typescript - throwsUncaught TypeError: Cannot read property 'Symbol(__APOLLO_CONTEXT__)' of undefined at getApolloContext (ApolloContext.ts:32)
during the first render.I originally encountered this issue a little while (~2 months) ago trying to migrate some projects from
apollo-boost
+@apollo/react-hooks
to@apollo/client
, but didn't have the time to follow it up properly. I have just picked it back up again and still facing the same error, after having updated to latest dependencies such as webpack and ts-loader. The only mention of this issue I could ever find was here.Intended outcome:
Everything works ok (renders) using
@apollo/client
ApolloProvider
Actual outcome:
Client crashes on first render with the following error:
How to reproduce the issue:
This happened when trying to migrate some projects from using
apollo-boost
and@apollo/react-hooks
to@apollo/client
v3.x.I created a minimal test repo from scratch - it is a simple
webpack
setup with TypeScript viats-loader
. It is essentially the minimum needed to render an Apollo Provider with a client with React & TypeScript. So I'm surprised no-one else has encountered/reported this issue yet! I have tested this and reproduced on multiple machines, and also had the exact same issue on every other project I've tried to use the latest@apollo/client
on (All the projects have a similar set up of webpack + typescript).Versions
The text was updated successfully, but these errors were encountered: