You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
using @tanstack/start-server-core root imports causes build issues with vite dev server #38
When using @auth0/auth0-tanstack-start-react in a TanStack Start application with Vite dev / SSR dependency pre-bundling (such as with @cloudflare/vite-plugin or Vite 6 environment dependency optimization), the dev server fails during dependency optimization with:
Error: Error during dependency optimization:
Build failed with 2 errors:
[RESOLVE_ERROR] Could not resolve '#tanstack-router-entry' in node_modules/@tanstack/start-server-core/dist/esm/createStartHandler.js
28 │ import("#tanstack-router-entry"),
╵ ───────────────────────── Package import specifier is not defined
[RESOLVE_ERROR] Could not resolve '#tanstack-start-entry' in node_modules/@tanstack/start-server-core/dist/esm/createStartHandler.js
29 │ import("#tanstack-start-entry"),
╵ ──────────────────────── Package import specifier is not defined
Root Cause
In src/server/cookie-handler.ts, src/server/handlers.ts, src/server/auth0-server.ts, and src/server/redirect-uri.ts, request and cookie utilities are imported from
@tanstack/start-server-core:
import { getCookie, getCookies, setCookie, deleteCookie } from '@tanstack/start-server-core';
import { getRequest, getResponseHeaders } from '@tanstack/start-server-core';
The root export . of @tanstack/start-server-core (dist/esm/index.js) re-exports createStartHandler.js, which imports #tanstack-router-entry and #tanstack-start-entry. These # specifiers are virtual Node subpath imports intended only for the TanStack Start runtime server entrypoint and cannot be resolved when dependency optimizers pre-bundle @tanstack/start-server-core.
Proposed Fix
Import the request and cookie utilities directly from @tanstack/start-server-core/request-response, which is the official subpath export declared in @tanstack/start-server-core's package.json:
This subpath contains all required helpers (getCookie, setCookie, deleteCookie, getCookies, getRequest, getResponseHeaders) without pulling in createStartHandler or unresolvable virtual entry aliases.
Files to Update
src/server/cookie-handler.ts
src/server/handlers.ts
src/server/auth0-server.ts
src/server/redirect-uri.ts
and their corresponding test files (auth0-server.test.ts, handlers.test.ts, redirect-uri.test.ts)
Activity
xeofd commentedon Sep 12, 2026
Have raise a PR with the updated imports here, #39
nandan-bhat commentedon Sep 15, 2026
This issue is fixed in the PR #39.
The PR is merged to
main. Closing this issue.