-
Notifications
You must be signed in to change notification settings - Fork 29
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
"Expected preloadedQuery to not be disposed yet." error #69
Comments
I haven't seen this error in production mode at all, only sometimes in dev when interrupting the loading process. That said, we're still on React 17 at Revere so it makes sense. I'll try upgrading soon and update here! |
If you are using strict mode react renders the component twice. If you use an effect to dispose of your query you might get this error. In that case in your effect fetch the preload the query again.
|
We have this issue too since we started using React 18 with strict mode. @phikes thanks for your input, a quick search in this codebase highlighted this piece of code: relay-nextjs/relay-nextjs/src/wired/component.tsx Lines 114 to 117 in d9ad8aa
Would this be the cause? the however the effect that disposes the query on unmount also calls load on mount, so I am not sure if the issue comes from here. |
I am not sure, I actually just stumbled across this issue. I had the same problem with another stack. But this looks very much like the culprit to me, yes. It looks more like a "real" race condition here. |
We have a new version we've been testing internally that replaces this code path I'll work on releasing soon! |
@rrdelaney Any update on this issue? |
Hey Jason, we've removed that exact codepath in 2.0. Are you continuing to see the issue after upgrading? |
First of all, thank you for the library 🙏
For one of my component, I'm using the
useQueryLoader
+usePreloadedQuery
hooks.Everything was working flawlessly until I updated from React 17.0.2 to 18.1.0. I started getting:
It's not crashing or anything, it's just a warning and it actually disappears when going to prod, but I was wondering if it would ring a bell to you. I really cannot find anything online :/
The text was updated successfully, but these errors were encountered: