Which project does this relate to?
Start
Describe the bug
Similar to this bug report, but it happens without middlewares.
Your Example Website or App
I don't have it
Steps to Reproduce the Bug or Issue
- I have a
foo.functions.ts file that imports auth.ts
- I have an
auth.ts file with import { env } from "cloudflare:workers"
It explodes trying to add cloudflare:workers into the client bundle.
If I move the import { env } from "cloudflare:workers" into foo.functions.ts file and pass it as a dependency (my current fix), then it works.
So it looks like the tree shacking or whatever mechanism is used to clean server functions for client bundles, only works at 1 level depth.
Expected behavior
Not to blow up
Screenshots or Videos
No response
Platform
@cloudflare/vite-plugin 1.32.2
@tanstack/react-router 1.168.10
@tanstack/react-start 1.167.16
vite 8.0.0
Additional context
No response
Which project does this relate to?
Start
Describe the bug
Similar to this bug report, but it happens without middlewares.
Your Example Website or App
I don't have it
Steps to Reproduce the Bug or Issue
foo.functions.tsfile that importsauth.tsauth.tsfile withimport { env } from "cloudflare:workers"It explodes trying to add cloudflare:workers into the client bundle.
If I move the
import { env } from "cloudflare:workers"intofoo.functions.tsfile and pass it as a dependency (my current fix), then it works.So it looks like the tree shacking or whatever mechanism is used to clean server functions for client bundles, only works at 1 level depth.
Expected behavior
Not to blow up
Screenshots or Videos
No response
Platform
@cloudflare/vite-plugin 1.32.2
@tanstack/react-router 1.168.10
@tanstack/react-start 1.167.16
vite 8.0.0
Additional context
No response