Weird polyfill issue that causes only production builds to work, but not dev builds #419
Unanswered
chen-anders
asked this question in
Q&A
Replies: 1 comment 1 reply
-
You can use vite-plugin-node-polyfills with rolldown-vite. Did you try that? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
We have a legacy JS script that is used as a media chooser (e.g. an API call is made to get a list of medias and they can choose one - think of it as a fancy selector). One issue that we faced with rolldown-vite coming from vite/rollup is that it seems like
vite-plugin-node-polyfills
builds the dev artifact with the necessary polyfills included. However, when using rolldown-vite and https://github.com/rolldown/rolldown-plugin-node-polyfills, we end up in a weird situation where the prod build work perfectly fine, but the dev builds don't work because there's no polyfills.For this JS script, we compile it manually and access it via a separate HTTP server (instead of the vite dev server), we would expect the behavior to be the same across rolldown-vite and vite+rollup despite the fact that the Vite site mentions that Vite doesn't intentionally load polyfills in dev.
Version of rolldown-vite: 7.1.7
I'm opening this issue because I'm kind of at a dead-end at what I should look at next.
Reproduction
N/A
Steps to reproduce
No response
System Info
Used Package Manager
yarn
Logs
No response
Validations
Beta Was this translation helpful? Give feedback.
All reactions