-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In the module resolution playground app the react import works during dev but not build #82
Comments
You need to add |
This is the problematic piece of code: react code Without In dev, in the pre-bundled react file But in the built output it is not: which explains why we are encountering the problem for build but not for dev So what I need to do now is understanding why rollup doesn't resolve |
Ok I think this sums up the rollup issue quite well: rollup/rollup#487 |
Ok this seems to be working quite well: With it the react development code does get treeshaken away! 🚀 I think this might be the appropriate solution (I can create a PR with this as a followup to #72) |
Nice! This feels like a weird one because you would expect people to run into this a lot. |
yeah I totally agree... 😕 I even wonder if something like this should be upstreamed in vite itself, isn't replacing |
If you run the module resolution playground app in dev mode everything seems to be working fine
But if you run it in preview mode and fetch from
/third-party/react
you get the following error:(which is something we've seen in the past: #22)
Something is not adding up here to me, because in the module resolution app I don't see us opting in nodejs_compat anywhere, so should this issue not be present for
dev
as well?Additionally if I add
to the
wrangler.toml
file, then both for dev and build the app breaks completely erroring that theunenv/runtime/node/process/$cloudflare
module can't be foundThe text was updated successfully, but these errors were encountered: