-
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
React native - cannot read property 'FIELD' of undefined #10632
Comments
Can you reproduce that issue in our React Native error-reproduction example app? Or, maybe looking at that even already helps you to see if something is wrong on your side? 🤞 |
Cheers for getting back to me - I'll see what I can do to try reproducing it on that repo. |
Also seeing this issue using vite 4 + sveltekit in dev mode |
@lmcgartland Could you please create a reproduction of this that we can investigate? |
I was facing exactly the same issue till I downgrade my @apollo/client library to 3.7.2. I was using 3.7.10- |
@ggchicote I might sound like a broken record here, but: We are not seeing this problem. We cannot help anyone until we are shown how exactly it occurs. |
I will do my best to get around to that as soon as possible. In the meantime, I was able to work around the issue by importing directly from the common js files instead of the es modules. |
Hi all 👋 This is due to the way the Metro bundler supports I've added a section to our React Native docs: https://www.apollographql.com/docs/react/integrations/react-native/#troubleshooting:
const { getDefaultConfig } = require('@expo/metro-config');
const config = getDefaultConfig(__dirname);
config.resolver.sourceExts.push(
'cjs'
);
module.exports = config; |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I'm using react native along with apollo graphql and I'm getting an issue with the client in which a certain property 'FIELD' cannot be read. This happens whenever I try to instantiate the apollo client, like so:
The dependencies of note in my package-json are:
I have tried adding the cjs and mjs files to metro so that they can be interpreted:
But this hasn't helped with the issue at all, nor has downgrading
graphql
to15.8.0
as stated here: https://www.apollographql.com/docs/react/get-started/The text was updated successfully, but these errors were encountered: