-
-
Notifications
You must be signed in to change notification settings - Fork 6
Errors when multiple versions of same browser is specified in build.target
#140
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
Comments
build,target
build.target
This could be a bit more resilient (or at least give a better error message) - but the target set in the example is ambiguous. Should it be transformed for targeting I see merit in having a better behavior there, especially as you the default As a workaround, you can dedupe the browsers and remove non-supported for now. Old:
|
It should target both. While unlikely, it's not impossible that a feature that was enabled in an older version of a browser may have been disabled in a newer version of the same browser. I think the transformer should consider multiple versions as separate browsers, just like when targeting multiple browsers like chrome/edge/safari/firefox in the same |
FWIW this is what we do:
|
Regarding this error, I did some logging and testing in esbuild:
It resolves to the last value. Testing in the playground:
So to our surprise, esbuild just picks the last value for the target. I'm in favor of keeping the current behavior (report I can report this to esbuild to surface the problem. |
I think this is reasonable as it might unveil unwanted/implicit behavior. A workaround seems also not too difficult (given you could set cc @sapphi-red this should probably be added to #84 as known limitation |
So using Is it not possible to treat those as separate browsers, and transform code so that the full browser matrix can be supported? I don't think esbuild's behavior should be preserved either. |
It would be a breaking change if we do differently with esbuild, so I'm happy to:
|
I don't think it's that much of a breaking change 🤷♂ |
build.target
build.target
build.target
build.target
Describe the bug
It seems like this is enough to crash rolldown-vite when running
vite build
:This does not happen with
vite serve
orvitest
.Reproduction
adazzle/react-data-grid#3771
Steps to reproduce
Configure a target with the last to version of modern browsers, then run
vite build
.System Info
Used Package Manager
npm
Logs
Click to expand!
Validations
The text was updated successfully, but these errors were encountered: