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
^2.9.2 breaks React with react-query #7736
Comments
Maybe the same as #7721? |
I don't think there exists a way to apply the Vue workaround for React unfortunately :/ |
I worked around it like this in my app: let resolveAliases: AliasOptions = [
// TODO: remove when https://github.com/vitejs/vite/issues/7721 is fixed.
{
find: 'react-query/devtools',
replacement: 'react-query/es/devtools/index',
},
]; |
Yep, this works, thank you! I've got mine like this:
However I think I'm probably just going to pin |
Thanks for the reports. We may need to revert #7582, and have another take at it in Vite v3. |
I'm not sure if it's related but I also found pinning to 2.9.1 was helpful cause I found 2.9.2 broke https://github.com/cmdcolin/vite-jbrowse-react-linear-genome-view/pull/1 (this is not a minimal repro) hard to say exactly why it broke, the error message is related to some internal typechecking system (mobx-state-tree)...could be an ESM vs cjs type thing perhaps but I wouldn't know without investigating further |
Closed in vite@2.9.5, where #7582 has been reverted |
Describe the bug
We have a React app with Vite, it worked perfectly on
2.9.1
.After updating to anything above
^2.9.2
we get the following console error when starting the app:While trying to render:
The error comes from the package react-query, which afaik hasn't made any recent changes.
Any ideas why this is happening? The error goes away if we pin to
2.9.1
.My hunch is that the latest update must've broken some React functionality, but this is the only place where that functionality is used.
Reproduction
https://stackblitz.com/edit/vitejs-vite-rhq817?file=src%2Fmain.tsx&terminal=dev
Wait for page to load, error will appear in the browser console.
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: