Skip to content

Commit 5ee7b1f

Browse files
committed
fix(tanstackstart-react): Add workerd and worker export conditions
Add `workerd` and `worker` export conditions to the `.` entry in package.json, pointing to `index.server.js`. This prevents the Cloudflare Vite plugin's resolve conditions (`workerd`, `worker`, `module`, `browser`) from falling through to the `browser` condition, which would resolve to `index.client.js` and trigger TanStack Start's import-protection plugin rejecting `*.client.*` files in the server environment. Users deploying to Cloudflare Workers will need `nodejs_compat` enabled in their wrangler configuration. A dedicated Cloudflare entrypoint (without `@sentry/node` dependency) will be addressed in a follow-up PR.
1 parent 60969fc commit 5ee7b1f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/tanstackstart-react/package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@
1919
"./package.json": "./package.json",
2020
".": {
2121
"types": "./build/types/index.types.d.ts",
22+
"workerd": {
23+
"import": "./build/esm/index.server.js",
24+
"require": "./build/cjs/index.server.js"
25+
},
26+
"worker": {
27+
"import": "./build/esm/index.server.js",
28+
"require": "./build/cjs/index.server.js"
29+
},
2230
"browser": {
2331
"import": "./build/esm/index.client.js",
2432
"require": "./build/cjs/index.client.js"

0 commit comments

Comments
 (0)