-
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
UseFragment producing a warning during store misses (TypeError: Cannot read properties of undefined) #12051
Comments
Hey @alex-e-leon! You beat me to opening this 😆. I discovered this just recently working with the data masking feature. We did some rework with |
This is the punishment I get for staying up to date with all the latest deps : ) And thanks @jerelmiller - its great to get such fast feedback and see that you're already on top of it! |
Not on you 😆. We unfortunately had a missing test so we didn't see the regression on our end. I just opened #12052 which should fix the issue. Could you try this snapshot release to see if the warning goes away?
|
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better. |
@jerelmiller - sorry, I've been super busy this week, so probably don't have time to test the branch right now. But looks like you guys are on top of it. Thanks for the quick response and looking forward to seeing it in the next release! |
You're welcome! I just got it released so you can to upgrade to 3.11.7 and the warning should disappear. Thanks again for reporting the issue! |
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. |
Issue Description
Since @apollo/client 3.11.5 I've started receiving warnings in the console during store misses of useFragment in development:
TypeError: Cannot read properties of undefined (reading '__typename')
A bit of testing suggests that this happens in all my uses of useFragment during store misses.
Note that although I get the warning, everything continues to work fine. @apollo/client 3.11.4 did not have this issue.
In case it's relevant I'm using the following arguments on useFragment:
fragment, fragmentName, from: {__typename: X, id: X}
The full stack trace is:
Link to Reproduction
None
Reproduction Steps
Call useFragment on any fragment which hasn't been loaded into the FE cache/store by typename + id.
@apollo/client
version3.11.5
The text was updated successfully, but these errors were encountered: