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
HMR crash (under very specific circumstances) #1353
Comments
This is one funky bug |
Additional context
|
Just tested this using the latest version of TSR, and I don't see these error messages any more. @jakst could you confirm? |
@SeanCassiere the issue is still there in v1.26.7/v1.26.8. The error message changed a bit though. It's now I forgot to mention in the instructions that you have to actually make a change in the file to trigger the error, so that might be why you can't reproduce. Here's the upgraded version https://stackblitz.com/edit/github-szfxdx-jvydpf?file=__generated__%2FbQuery.graphql.ts |
Yup you are right. Honestly its hard to determine where this problem lies. Good news is that making the project use the new |
I wouldn't consider it closed because of automatic code splitting though. We use Relay which indirectly enforces manual conventions on our page file names, so we need to use manual code splitting. Until this works in all available modes, I would like to keep this open. |
Any updates here? Running into the same issue in our project as well. |
My app also crashes when fast-refreshing, although it manifests as a hook provider not existing:
Not sure if its the same issue, but it also happens when saving a file causing a hot refresh. |
So I managed to fix my problem and I'm not sure it is related to this issue after all but in case someone ends up here after searching HMR, here is what I found. It seems that if a context provider is declared outside of the
is not ok. Instead I needed to move |
Describe the bug
I've got a real interesting HMR bug. It only happens under very specific circumstances.
This is the error message
Of course there's only one _layout file in my file tree, not two, so tanstack is adding an extra layout.
Your Example Website or App
https://stackblitz.com/edit/github-szfxdx?file=README.md
Steps to Reproduce the Bug or Issue
pnpm install
pnpm dev
which is the problematic route)
Expected behavior
HMR shouldn't crash the page when editing files.
Screenshots or Videos
No response
Platform
Stackblitz
Additional context
I can only get it to reproduce with Relay in the mix, but the double
_layout
in the error message still makes me believe it's tanstack causing the error.The error only happens under the very specific circumstances I put together in the repro. If the main.tsx and router.tsx files are merged into one, the error disappears. Without lazy routes, the error disappears. Without the nested layout, the error disappears.
The text was updated successfully, but these errors were encountered: