Skip to content
Source
Sign inSign up
TanStack/router

Hot reload throws issue #5277

Send to my agent
ClosedChristopher96u(GitHub profile, opens in a new tab) opened this issue 8 comments

Which 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:

Image

Your Example Website or App

https://github.com/Christopher96u/educore-teacher-app/tree/issue-demo

Steps to Reproduce the Bug or Issue

  1. Update code
  2. Save changes
  3. 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

  1. 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.

  2. 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?

  3. 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.

  4. this should not be necessary. we are looking into this issue

  5. 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.ts file 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.ts has no effect for me:

    import handler from "@tanstack/react-start/server-entry"
    
    export default {
      fetch(request: Request) {
        return handler.fetch(request)
      },
    }
  6. 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.ts file 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.ts has 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.

Sign in to join this conversation.