Skip to content
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

Apply same bad version ignoring logic to targets config #3501

Closed
steveluscher opened this issue Nov 21, 2023 · 1 comment
Closed

Apply same bad version ignoring logic to targets config #3501

steveluscher opened this issue Nov 21, 2023 · 1 comment

Comments

@steveluscher
Copy link

0e1696f added some code that skips over bad version numbers from caniuse. It looks like we could also use that logic to filter out bad versions supplied through target.

For instance, if you use browserslist-to-esbuild right now it is likely not to work because of the presence of the version safariTP.

[ERROR] Invalid version: "TP"

  All version numbers passed to esbuild must be in the format "X", "X.Y", or "X.Y.Z" where X, Y, and Z are non-negative integers.

Repro: https://esbuild.github.io/try/#dAAwLjE5LjcAe3RhcmdldDonc2FmYXJpVFAnfQA

@evanw
Copy link
Owner

evanw commented Nov 22, 2023

I don't think esbuild is the correct place to handle this. I think browserslist-to-esbuild shouldn't be generating this value in the first place. The value TP doesn't correspond to any specific version of Safari, so it's unclear what esbuild should be replacing it with.

From what I understand the way browserslist-to-esbuild works is that it gets a list of browser versions from browserslist, filters them to the ones that esbuild supports, and then picks the last one. In this case the last one is safariTP which is invalid, but esbuild would need to fall back to the next-to-last one, except esbuild has no way of knowing what that is. That information is something that browserslist-to-esbuild has to provide because it's the only thing with that information.

Please file a bug with browserslist-to-esbuild about this instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants