Skip to content

Could not resolve "#tanstack-router-entry" #5795

Open
better-auth/better-auth
#6387

Description

@austinm911

Which project does this relate to?

Start

Describe the bug

I'm out of town this weekend but was running into this so wanted to file this bug report sooner than later.

I'm using alchemy, which wraps cloudflare-vite to run tanstack start. I haven't had time to create a clean reproduction but basically what seems to be happening, is that my auth service is created as an Effect.Service from effect-ts. One of the other deps coming is is my Drizzle postgres client from '@effect/sql-drizzle/Pg'.

As soon as i import import { auth } from '@repo/core/auth/handler' into server.ts or routes/api/auth/$.ts my app blows up with the error below. handler.ts imports my Runtime from effect, which has all my app dependencies, which some are required for some of the hooks that better auth calls in the Effectful Better Auth instance.

Possibly related to vitejs/vite#20867 (comment). I was seeing pre-bundling issues on later versions of vite.

The web app producing this error is a basic better-t-stack templated start app, with the only changes adding in alchemy and dropping in my auth into the server route. Everything starts up fine without the eventual better-auth dependency as described above.

Using vars defined in process.env
3:21:50 PM [vite] (client) Re-optimizing dependencies because lockfile has changed

  VITE v7.0.0  ready in 1097 ms

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose
  ➜  Debug:   http://localhost:5173/__debug
  ➜  press h + enter to show help
[updating]  web Updating Resource...
[skipped]   web > url Skipped Resource (no changes)
[updated]   web Updated Resource
Web    -> http://localhost:5173/
✘ [ERROR] Could not resolve "#tanstack-router-entry"

    ../../node_modules/.bun/@tanstack+start-server-core@1.134.15+b0d3c3aaff3e390a/node_modules/@tanstack/start-server-core/dist/esm/createStartHandler.js:29:33:
      29 │       routerEntry = await import("#tanstack-router-entry");
         ╵                                  ~~~~~~~~~~~~~~~~~~~~~~~~

  The package import "#tanstack-router-entry" is not defined in this "imports" map:

    ../../node_modules/.bun/@tanstack+start-server-core@1.134.15+b0d3c3aaff3e390a/node_modules/@tanstack/start-server-core/package.json:49:13:
      49 │   "imports": {
         ╵              ^

  You can mark the path "#tanstack-router-entry" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle. You can also add ".catch()" here to handle this failure at run-time instead of bundle-time.

✘ [ERROR] Could not resolve "#tanstack-start-entry"

    ../../node_modules/.bun/@tanstack+start-server-core@1.134.15+b0d3c3aaff3e390a/node_modules/@tanstack/start-server-core/dist/esm/createStartHandler.js:32:32:
      32 │       startEntry = await import("#tanstack-start-entry");
         ╵                                 ~~~~~~~~~~~~~~~~~~~~~~~

  The package import "#tanstack-start-entry" is not defined in this "imports" map:

    ../../node_modules/.bun/@tanstack+start-server-core@1.134.15+b0d3c3aaff3e390a/node_modules/@tanstack/start-server-core/package.json:49:13:
      49 │   "imports": {
         ╵              ^

  You can mark the path "#tanstack-start-entry" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle. You can also add ".catch()" here to handle this failure at run-time instead of bundle-time.

✘ [ERROR] Could not resolve "tanstack-start-manifest:v"

    ../../node_modules/.bun/@tanstack+start-server-core@1.134.15+b0d3c3aaff3e390a/node_modules/@tanstack/start-server-core/dist/esm/router-manifest.js:3:44:
      3 │ ...t { tsrStartManifest } = await import("tanstack-start-manifest:v");
        ╵                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~

  You can mark the path "tanstack-start-manifest:v" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle. You can also add ".catch()" here to handle this failure at run-time instead of bundle-time.

✘ [ERROR] Could not resolve "tanstack-start-injected-head-scripts:v"

    ../../node_modules/.bun/@tanstack+start-server-core@1.134.15+b0d3c3aaff3e390a/node_modules/@tanstack/start-server-core/dist/esm/router-manifest.js:9:49:
      9 │ ...Scripts } = await import("tanstack-start-injected-head-scripts:v");
        ╵                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  You can mark the path "tanstack-start-injected-head-scripts:v" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle. You can also add ".catch()" here to handle this failure at run-time instead of bundle-time.

3:22:06 PM [vite] (ssr) error while updating dependencies:
Error: Build failed with 4 errors:
../../node_modules/.bun/@tanstack+start-server-core@1.134.15+b0d3c3aaff3e390a/node_modules/@tanstack/start-server-core/dist/esm/createStartHandler.js:29:33: ERROR: Could not resolve "#tanstack-router-entry"
../../node_modules/.bun/@tanstack+start-server-core@1.134.15+b0d3c3aaff3e390a/node_modules/@tanstack/start-server-core/dist/esm/createStartHandler.js:32:32: ERROR: Could not resolve "#tanstack-start-entry"
../../node_modules/.bun/@tanstack+start-server-core@1.134.15+b0d3c3aaff3e390a/node_modules/@tanstack/start-server-core/dist/esm/router-manifest.js:3:44: ERROR: Could not resolve "tanstack-start-manifest:v"
../../node_modules/.bun/@tanstack+start-server-core@1.134.15+b0d3c3aaff3e390a/node_modules/@tanstack/start-server-core/dist/esm/router-manifest.js:9:49: ERROR: Could not resolve "tanstack-start-injected-head-scripts:v"
    at failureErrorWithLog (/Users/am/Coding/redacted-projects/redacted/node_modules/.bun/esbuild@0.25.12/node_modules/esbuild/lib/main.js:1467:15)
    at /Users/am/Coding/redacted-projects/redacted/node_modules/.bun/esbuild@0.25.12/node_modules/esbuild/lib/main.js:926:25
    at /Users/am/Coding/redacted-projects/redacted/node_modules/.bun/esbuild@0.25.12/node_modules/esbuild/lib/main.js:1345:9
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
3:22:06 PM [vite] Internal server error: There is a new version of the pre-bundle for "/Users/am/Coding/redacted-projects/redacted/apps/web/node_modules/.vite/deps_ssr/better-auth.js?v=93306dc9", a page reload is going to ask for it.
      at CustomModuleRunner.cachedModule (workers/runner-worker.js:1236:20)
      at request (workers/runner-worker.js:1154:83)
      at null.<anonymous> (/Users/am/Coding/redacted-projects/redacted/packages/core/src/auth/setup.ts:4:1)
      at Object.runInlinedModule (workers/runner-worker.js:1337:4)
      at CustomModuleRunner.directRequest (workers/runner-worker.js:1208:59)
      at CustomModuleRunner.cachedRequest (workers/runner-worker.js:1115:73)
      at null.<anonymous> (/Users/am/Coding/redacted-projects/redacted/packages/core/src/auth/handler.ts:2:1)
      at Object.runInlinedModule (workers/runner-worker.js:1337:4)
      at CustomModuleRunner.directRequest (workers/runner-worker.js:1208:59)
      at CustomModuleRunner.cachedRequest (workers/runner-worker.js:1115:73)
3:22:06 PM [vite] Internal server error: There is a new version of the pre-bundle for "/Users/am/Coding/redacted-projects/redacted/apps/web/node_modules/.vite/deps_ssr/better-auth.js?v=93306dc9", a page reload is going to ask for it.
      at CustomModuleRunner.cachedModule (workers/runner-worker.js:1236:20)
      at request (workers/runner-worker.js:1154:83)
      at null.<anonymous> (/Users/am/Coding/redacted-projects/redacted/packages/core/src/auth/setup.ts:4:1)
      at Object.runInlinedModule (workers/runner-worker.js:1337:4)
      at CustomModuleRunner.directRequest (workers/runner-worker.js:1208:59)
      at CustomModuleRunner.cachedRequest (workers/runner-worker.js:1115:73)
      at null.<anonymous> (/Users/am/Coding/redacted-projects/redacted/packages/core/src/auth/handler.ts:2:1)
      at Object.runInlinedModule (workers/runner-worker.js:1337:4)
      at CustomModuleRunner.directRequest (workers/runner-worker.js:1208:59)
      at CustomModuleRunner.cachedRequest (workers/runner-worker.js:1115:73)

Your Example Website or App

N/A

Steps to Reproduce the Bug or Issue

see above

Expected behavior

no issues

Screenshots or Videos

No response

Platform

Vite 7.0.0
MacOS 15.6
Tanstack 1.134.15

Additional context

No response

Activity

  1. schiller-manuel commented on Nov 8, 2025

    @schiller-manuel
    Collaborator

    please share a full reproduction project

  2. guillemus commented on Nov 10, 2025

    @guillemus

    not op but I have the same error in this repo

    https://github.com/guillemus/tanstack-mpa

    This happened after I tried to add better auth. Maybe it is bc there's no entry-client / server files? That's what haiku suggested me but idk.

    here's the full output:

    
    ➜  tanstack-mpa git:(main) ✗ bun dev
    $ vite dev --port 3000
    
      VITE v7.2.2  ready in 417 ms
    
      ➜  Local:   http://localhost:3000/
      ➜  Network: use --host to expose
      ➜  press h + enter to show help
    ✘ [ERROR] Could not resolve "#tanstack-router-entry"
    
        node_modules/@tanstack/start-server-core/dist/esm/createStartHandler.js:29:33:
          29 │       routerEntry = await import("#tanstack-router-entry");
             ╵                                  ~~~~~~~~~~~~~~~~~~~~~~~~
    
      The package import "#tanstack-router-entry" is not defined in this "imports" map:
    
        node_modules/@tanstack/start-server-core/package.json:49:13:
          49 │   "imports": {
             ╵              ^
    
      You can mark the path "#tanstack-router-entry" as external to exclude it from the bundle, which
      will remove this error and leave the unresolved path in the bundle. You can also add ".catch()"
      here to handle this failure at run-time instead of bundle-time.
    
    ✘ [ERROR] Could not resolve "#tanstack-start-entry"
    
        node_modules/@tanstack/start-server-core/dist/esm/createStartHandler.js:32:32:
          32 │       startEntry = await import("#tanstack-start-entry");
             ╵                                 ~~~~~~~~~~~~~~~~~~~~~~~
    
      The package import "#tanstack-start-entry" is not defined in this "imports" map:
    
        node_modules/@tanstack/start-server-core/package.json:49:13:
          49 │   "imports": {
             ╵              ^
    
      You can mark the path "#tanstack-start-entry" as external to exclude it from the bundle, which
      will remove this error and leave the unresolved path in the bundle. You can also add ".catch()"
      here to handle this failure at run-time instead of bundle-time.
    
    ✘ [ERROR] Could not resolve "tanstack-start-manifest:v"
    
        node_modules/@tanstack/start-server-core/dist/esm/router-manifest.js:3:44:
          3 │   const { tsrStartManifest } = await import("tanstack-start-manifest:v");
            ╵                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
      You can mark the path "tanstack-start-manifest:v" as external to exclude it from the bundle, which
      will remove this error and leave the unresolved path in the bundle. You can also add ".catch()"
      here to handle this failure at run-time instead of bundle-time.
    
    ✘ [ERROR] Could not resolve "tanstack-start-injected-head-scripts:v"
    
        node_modules/@tanstack/start-server-core/dist/esm/router-manifest.js:9:49:
          9 │     const { injectedHeadScripts } = await import("tanstack-start-injected-head-scripts:v");
            ╵                                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
      You can mark the path "tanstack-start-injected-head-scripts:v" as external to exclude it from the
      bundle, which will remove this error and leave the unresolved path in the bundle. You can also add
      ".catch()" here to handle this failure at run-time instead of bundle-time.
    
    /Users/guillem/Documents/projects/tanstack-mpa/node_modules/esbuild/lib/main.js:1467
      let error = new Error(text);
                  ^
    
    Error: Error during dependency optimization:
    
    ✘ [ERROR] Could not resolve "#tanstack-router-entry"
    
        node_modules/@tanstack/start-server-core/dist/esm/createStartHandler.js:29:33:
          29 │       routerEntry = await import("#tanstack-router-entry");
             ╵                                  ~~~~~~~~~~~~~~~~~~~~~~~~
    
      The package import "#tanstack-router-entry" is not defined in this "imports" map:
    
        node_modules/@tanstack/start-server-core/package.json:49:13:
          49 │   "imports": {
             ╵              ^
    
      You can mark the path "#tanstack-router-entry" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle. You can also add ".catch()" here to handle this failure at run-time instead of bundle-time.
    
    
    ✘ [ERROR] Could not resolve "#tanstack-start-entry"
    
        node_modules/@tanstack/start-server-core/dist/esm/createStartHandler.js:32:32:
          32 │       startEntry = await import("#tanstack-start-entry");
             ╵                                 ~~~~~~~~~~~~~~~~~~~~~~~
    
      The package import "#tanstack-start-entry" is not defined in this "imports" map:
    
        node_modules/@tanstack/start-server-core/package.json:49:13:
          49 │   "imports": {
             ╵              ^
    
      You can mark the path "#tanstack-start-entry" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle. You can also add ".catch()" here to handle this failure at run-time instead of bundle-time.
    
    
    ✘ [ERROR] Could not resolve "tanstack-start-manifest:v"
    
        node_modules/@tanstack/start-server-core/dist/esm/router-manifest.js:3:44:
          3 │ ...t { tsrStartManifest } = await import("tanstack-start-manifest:v");
            ╵                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
      You can mark the path "tanstack-start-manifest:v" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle. You can also add ".catch()" here to handle this failure at run-time instead of bundle-time.
    
    
    ✘ [ERROR] Could not resolve "tanstack-start-injected-head-scripts:v"
    
        node_modules/@tanstack/start-server-core/dist/esm/router-manifest.js:9:49:
          9 │ ...Scripts } = await import("tanstack-start-injected-head-scripts:v");
            ╵                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
      You can mark the path "tanstack-start-injected-head-scripts:v" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle. You can also add ".catch()" here to handle this failure at run-time instead of bundle-time.
    
    
        at failureErrorWithLog (/Users/guillem/Documents/projects/tanstack-mpa/node_modules/esbuild/lib/main.js:1467:15)
        at /Users/guillem/Documents/projects/tanstack-mpa/node_modules/esbuild/lib/main.js:926:25
        at /Users/guillem/Documents/projects/tanstack-mpa/node_modules/esbuild/lib/main.js:1345:9
        at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
      errors: [Getter/Setter],
      warnings: [Getter/Setter]
    }
    
    Node.js v22.17.1
    error: script "dev" exited with code 1
    
    
  3. guillemus commented on Nov 10, 2025

    @guillemus

    @schiller-manuel I found what causes the issue somehow.

    to reproduce:

    • clone the repo
    • rm -rf .tanstack && bun i
    • you should see the error when running bun dev
    • comment out all code from counter.ts file
    • bun dev should now work.
    • uncomment back the code from counter.ts
    • bun dev should now work with the original code.

    I hope this helps

  4. austinm911 commented on Nov 10, 2025

    @austinm911
    Author

    @guillemus Even adding the client/server.ts entry files, I run into the same issues as well

  5. theoludwig commented on Nov 11, 2025

    @theoludwig

    I have the same issue but with Vitest.

  6. schiller-manuel commented on Nov 11, 2025

    @schiller-manuel
    Collaborator

    @theoludwig can you share a reproducer project with vitest?

  7. theoludwig commented on Nov 11, 2025

    @theoludwig

    @theoludwig can you share a reproducer project with vitest?

    Sure, here it is: https://github.com/theoludwig/vite-nitro-issues/tree/vitest-issue

    To reproduce:

    1. git clone git@github.com:theoludwig/vite-nitro-issues.git
    2. cd vite-nitro-issues
    3. git checkout vitest-issue
    4. pnpm install --frozen-lockfile
    5. node --run test
  8. gianlazaro commented on Nov 20, 2025

    @gianlazaro

    I'll see if I have time to make a reproducer sometime this week, but I'm having this exact issue when I install a specific library.

    better-auth@beta (since 1.4 stable is coming out Friday)

  9. rollsrobby commented on Nov 20, 2025

    @rollsrobby

    I only see this issue if I enable the reactStartCookie plugin by better-auth.
    And only after removing the node_modules folder and reinstalling(pnpm install).
    If I remove the plugin, clean, install. All works fine.
    Maybe this observation helps..

  10. gianlazaro commented on Nov 20, 2025

    @gianlazaro

    @rollsrobby That did the trick for me!

    It got me curious and looked into what could possibly be making this issue.

    I was able to reproduce the original poster's issue by using setCookie imported from "@tanstack/react-start/server" (used in certain cases). I hope this narrows it down for you, @schiller-manuel

    update: I guess it's mostly affects improper uses of functions that should only run on the server like setting cookies, or headers that causes the error.

  11. 2bdelghafour commented on Nov 20, 2025

    @2bdelghafour

    @gianlazaro I ran into the same issue when using Better Auth with Tanstack Start and I can see there is already a PR open on their end to fix it by using the proper imports

    better-auth/better-auth#6045

  12. dotnize commented on Nov 22, 2025

    @dotnize
    Contributor
  13. gianlazaro commented on Nov 26, 2025

    @gianlazaro

    @dotnize @2bdelghafour

    1.4.1 fixed the issue but 1.4.2 (released a couple of hours ago) reverts back to importing start-server-core because it apparently fixes the cookies issue on with solid on tanstack start.

    We're back to the same issue.

    better-auth/better-auth#6235

  14. 22 remaining items

  15. web-dev-sayantan commented on Jan 16, 2026

    @web-dev-sayantan

    Facing the same issue with @tanstack/* 1.150.0 and better-auth 1.4.13 in my repo,
    Opus 4.5 went on a crazy run, and fixed it for now with bunch of weird config in vite.config.ts, half of which I don't understand.

    import { defineConfig } from 'vite'
    import { tanstackStart } from '@tanstack/react-start/plugin/vite'
    import viteReact from '@vitejs/plugin-react'
    import viteTsConfigPaths from 'vite-tsconfig-paths'
    import tailwindcss from '@tailwindcss/vite'
    import { cloudflare } from '@cloudflare/vite-plugin'
    import type { Plugin as EsbuildPlugin } from 'esbuild'
    
    // Plugin to mark TanStack Start virtual modules as external
    const tanstackExternalPlugin: EsbuildPlugin = {
      name: 'tanstack-external',
      setup(build) {
        build.onResolve({ filter: /^#tanstack-|^tanstack-start-/ }, () => ({
          external: true,
        }))
      },
    }
    
    export default defineConfig({
      server: {
        port: 3000,
      },
      plugins: [
        tailwindcss(),
        viteTsConfigPaths({
          projects: ['./tsconfig.json'],
        }),
        cloudflare({
          viteEnvironment: { name: 'ssr' },
          inspectorPort: false,
        }),
        tanstackStart(),
        viteReact(),
      ],
      optimizeDeps: {
        esbuildOptions: {
          plugins: [tanstackExternalPlugin],
        },
      },
      environments: {
        ssr: {
          optimizeDeps: {
            esbuildOptions: {
              plugins: [tanstackExternalPlugin],
            },
          },
        },
      },
      build: {
        rollupOptions: {
          external: ['cloudflare:workers'],
        },
      },
    })
  16. ludusrusso commented on Jan 16, 2026

    @ludusrusso

    @tanstack/* 1.150.0 and better-auth 1.4.13 in my repo

    same here

  17. joshymcd commented on Jan 16, 2026

    @joshymcd

    I was just having this issue.
    For me excluding my Tanstack packages from Vites dev server optimisations seemed to do the trick

    vite.config.ts

      optimizeDeps: {
        // Exclude TanStack Start packages from Vite's dependency optimization
        // to prevent issues with virtual imports (#tanstack-router-entry, etc.)
        exclude: [
          '@tanstack/start-server-core',
          '@tanstack/react-start',
          '@tanstack/react-start/client',
          '@tanstack/react-start/server',
        ],
      },
  18. williiam-tran commented on Jan 17, 2026

    @williiam-tran

    I was just having this issue. For me excluding my Tanstack packages from Vites dev server optimisations seemed to do the trick

    vite.config.ts

    optimizeDeps: {
    // Exclude TanStack Start packages from Vite's dependency optimization
    // to prevent issues with virtual imports (#tanstack-router-entry, etc.)
    exclude: [
    '@tanstack/start-server-core',
    '@tanstack/react-start',
    '@tanstack/react-start/client',
    '@tanstack/react-start/server',
    ],
    },

    This works for me!

  19. kusalkalinga00 commented on Jan 17, 2026

    @kusalkalinga00

    I was just having this issue. For me excluding my Tanstack packages from Vites dev server optimisations seemed to do the trick

    vite.config.ts

    optimizeDeps: {
    // Exclude TanStack Start packages from Vite's dependency optimization
    // to prevent issues with virtual imports (#tanstack-router-entry, etc.)
    exclude: [
    '@tanstack/start-server-core',
    '@tanstack/react-start',
    '@tanstack/react-start/client',
    '@tanstack/react-start/server',
    ],
    },

    This worked for me also. Issue started to originate when I migrate from bun to pnpm.

  20. rgripper commented on Jan 17, 2026

    @rgripper

    I was just having this issue. For me excluding my Tanstack packages from Vites dev server optimisations seemed to do the trick

    vite.config.ts

    optimizeDeps: {
    // Exclude TanStack Start packages from Vite's dependency optimization
    // to prevent issues with virtual imports (#tanstack-router-entry, etc.)
    exclude: [
    '@tanstack/start-server-core',
    '@tanstack/react-start',
    '@tanstack/react-start/client',
    '@tanstack/react-start/server',
    ],
    },

    didnt help, I still have the same error

  21. astralarya commented on Jan 17, 2026

    @astralarya

    I started getting similar errors upgrading from 1.149.1 -> 1.151.1, which I was able to resolve by adding this to my vite config:

      optimizeDeps: {
        exclude: [
          "@tanstack/start-server-core",
          "@tanstack/start-client-core",
          "@tanstack/react-start",
        ],
      },

    On one hand, I'm glad that this fixes it, but on the other hand, I wish it weren't necessary.

  22. bytaesu commented on Jan 18, 2026

    @bytaesu

    from Better Auth,
    We've worked on this, I tested it in the actual app, and I can confirm that it's fixed now in v1.4.15 😄

  23. MarcusGasberg commented on Jan 24, 2026

    @MarcusGasberg

    Weirdly enough I still encountered it after upgrading, when I tried to deploy to Cloudflare workers. The issue was due to having multiple environments in my wrangler.toml and not passing the correct CLOUDFLARE_ENV to my build command. I also had to point to the generated wrangler.json file.

    Previous build command:

        "deploy:staging": "bun run build && bunx wrangler deploy --env=\"staging\" --keep-vars --config ./wrangler.toml",\
    

    Fixed:

       "deploy:staging": "CLOUDFLARE_ENV=staging bun run build && bunx wrangler deploy --keep-vars --config ./dist/server/wrangler.json",
    
  24. isc30 commented on Feb 16, 2026

    @isc30

    I started getting similar errors upgrading from 1.149.1 -> 1.151.1, which I was able to resolve by adding this to my vite config:

    optimizeDeps: {
    exclude: [
    "@tanstack/start-server-core",
    "@tanstack/start-client-core",
    "@tanstack/react-start",
    ],
    },
    On one hand, I'm glad that this fixes it, but on the other hand, I wish it weren't necessary.

    is this the properly-done-accepted way or just a hack?

  25. isc30 commented on Feb 19, 2026

    @isc30

    For the proper solution, see better-auth/better-auth#6045 (comment)
    Basically, replace the imports from @tanstack/react-start-server to @tanstack/react-start/server and vite will be happy.

    I believe this would be a good addition to the eslint plugin, to inform users to use the proper import to avoid vite dependency optimization issues.

  26. barbalex commented on Feb 27, 2026

    @barbalex

    Not sure if this is the same issue: In an app using tanstack router I tried to use tanstack start (to add server routes). When replacing TanStackRouterVite({ target: 'react', autoCodeSplitting: true }) with tanstackStart() I immediately get this error:

    TypeError: entries.routerEntry.getRouter is not a function
        at getRouter (/home/alex/Documents/GitHub/ps/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:472:44)
        ... 8 lines matching cause stack trace ...
        at async Object.fetch (/home/alex/Documents/GitHub/ps/node_modules/@tanstack/react-start/dist/plugin/default-entry/server.ts:16:14) {
      cause: TypeError: entries.routerEntry.getRouter is not a function
          at getRouter (/home/alex/Documents/GitHub/ps/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:472:44)
          at handleServerRoutes (/home/alex/Documents/GitHub/ps/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:724:24)
          at eval (/home/alex/Documents/GitHub/ps/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:606:28)
          at AsyncLocalStorage.run (node:internal/async_local_storage/async_context_frame:63:14)
          at runWithStartContext (/home/alex/Documents/GitHub/ps/node_modules/@tanstack/start-storage-context/src/async-local-storage.ts:34:23)
          at requestHandlerMiddleware (/home/alex/Documents/GitHub/ps/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:596:16)
          at next (/home/alex/Documents/GitHub/ps/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:279:22)
          at executeMiddleware (/home/alex/Documents/GitHub/ps/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:301:10)
          at startRequestResolver (/home/alex/Documents/GitHub/ps/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:627:25)
          at async Object.fetch (/home/alex/Documents/GitHub/ps/node_modules/@tanstack/react-start/dist/plugin/default-entry/server.ts:16:14),
      status: 500,
      statusText: undefined,
      headers: undefined,
      data: undefined,
      body: undefined,
      unhandled: true
    }
  27. added a commit that references this issue on May 3, 2026
  28. escwxyz commented on May 4, 2026

    @escwxyz

    Same error for basic start example with RSC, no better-auth, vite 8.

    Repro: https://github.com/escwxyz/tanstack-rsc-test

    Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions