Some server-side modules incorrectly bundled into the client?
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.1k
- Forks
- 1.9k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 143
Description
Which project does this relate to?
Start
Describe the bug
Starting with @tanstack/react-start@1.134.7, I think server-side modules are being incorrectly bundled into the client bundle. For example, in the Clerk SDK, this error shows up in the browser console when running dev server:
Uncaught (in promise) SyntaxError: The requested module '/node_modules/cookie/dist/index.js?v=d2ee33e7' does not provide an export named 'parse' (at chunk-CEKR2FXD.mjs?v=d2ee33e7:4283:10)Understand this error
client:865
Likely related to https://github.com/TanStack/router/issues/5717
Your Example Website or App
https://github.com/clerk/clerk-tanstack-react-start-quickstart/pull/6/files
Steps to Reproduce the Bug or Issue
- Clone the repo attached
- Switch to the
cookie-module-leakbranch - Run
npm run dev, see browser console
Expected behavior
Properly externalize server-side modules in client builds.
Screenshots or Videos
No response
Platform
- Router / Start Version: 1.134.9
- OS: [e.g. macOS, Windows, Linux]
- Browser: [e.g. Chrome, Safari, Firefox]
- Browser Version: [e.g. 91.1]
- Bundler: Vite
- Bundler Version: [e.g. 7.0.0]
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Clone the linked Clerk quickstart, switch to the cookie-module-leak branch, and run npm run dev to reproduce the browser error. Use the related TanStack Router issue 5717 and the client bundle behavior as starting points; done means server-side modules such as cookie are properly externalized from client builds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript, vite
- Domain
- build-system, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100