Hot reload throws issue #5277
Send to my agentWhich project does this relate to?#
Router
Describe the bug#
Demo: repo (Please check on that branch issue-demo)
Description:
If you remove any of the unused imports, or add new code somewhere under src/server/fns/signin.ts (I haven't tried other files) it throws an issue, this one:
Your Example Website or App#
https://github.com/Christopher96u/educore-teacher-app/tree/issue-demo
Steps to Reproduce the Bug or Issue#
- Update code
- Save changes
- Error will be displayed in terminal
Expected behavior#
As I user, I expect no issues on hot reload when I'm writing code
Screenshots or Videos#
No response
Platform#
- Router / Start Version: latest
- OS: macOs
- Browser: chrome
Additional context#
No response
I was able to fix this issue on my project by adding a server entry point file under 'src'. It does say on the page that TanStack already does it under the hood if not provided, but it doesn't seem like it with this error.
could you share an example?
I was able to fix this issue on my project by adding a server entry point file under 'src'. It does say on the page that TanStack already does it under the hood if not provided, but it doesn't seem like it with this error.
could you share an example?
I'm away from the desk at the moment but it's fairly straight forward.
Create 'src/server.ts' and add the snippet provided from the page I linked earlier.
this should not be necessary. we are looking into this issue
I can confirm the issue. It only shows once after the first change and hot reload (but the update on the site works). Afterwards (on subsequent changes), the error doesn't appear again.
However, in contrast to @gianlazaro, adding a
server.tsfile doesn't seem to have an effect for me (the error still appears for the first change after restarting the dev server).The error:
[vite] An error happened during full reload Failed to load url __tanstack-start-server-entry__.ts (resolved id: __tanstack-start-server-entry__.ts). Does the file exist? Error: Failed to load url __tanstack-start-server-entry__.ts (resolved id: __tanstack-start-server-entry__.ts). Does the file exist? at loadAndTransform (file:///workspaces/myapp/node_modules/.pnpm/vite@7.1.7_@types+node@24.5.2_jiti@2.6.0_sugarss@5.0.1_postcss@8.5.6__terser@5.44.0_tsx@4.20.6/node_modules/vite/dist/node/chunks/dep-Bm2ujbhY.js:26109:33)This
src/server.tshas no effect for me:import handler from "@tanstack/react-start/server-entry" export default { fetch(request: Request) { return handler.fetch(request) }, }I can confirm the issue. It only shows once after the first change and hot reload (but the update on the site works). Afterwards (on subsequent changes), the error doesn't appear again.
However, in contrast to @gianlazaro, adding a
server.tsfile doesn't seem to have an effect for me (the error still appears for the first change after restarting the dev server).The error:
[vite] An error happened during full reload Failed to load url __tanstack-start-server-entry__.ts (resolved id: __tanstack-start-server-entry__.ts). Does the file exist? Error: Failed to load url __tanstack-start-server-entry__.ts (resolved id: __tanstack-start-server-entry__.ts). Does the file exist? at loadAndTransform (file:///workspaces/myapp/node_modules/.pnpm/vite@7.1.7_@types+node@24.5.2_jiti@2.6.0_sugarss@5.0.1_postcss@8.5.6__terser@5.44.0_tsx@4.20.6/node_modules/vite/dist/node/chunks/dep-Bm2ujbhY.js:26109:33)This
src/server.tshas no effect for me:import handler from "@tanstack/react-start/server-entry"
export default { fetch(request: Request) { return handler.fetch(request) }, }
You're absolutely right, I guess I didn't dive deeper into the issue. Creating new routes brought the issue back for me.
Hopefully it gets resolved soon.
I can run perfectly without it.
https://github.com/TanStack/router/issues/5279#issuecomment-3344011452
same issue
Sign in to join this conversation.
I was able to fix this issue on my project by adding a server entry point file under 'src'. It does say on the page that TanStack already does it under the hood if not provided, but it doesn't seem like it with this error.