Safari TP in browserlist breaks ESBUILD code path

LukeSheard created this issue on 2021-11-12 · The issue is replied 4 times

If browserlist is configured to include Safari Technology Preview in browserslist then there is no equivalent for this in esbuild - this breaks the esbuild targets setup and causes a fatal error during startup.

cristiano-belloni wrote this answer on 2021-11-12

I can't reproduce this with the default configuration (which doesn't contain Safari TP) generated br CMRA 2.1.0

I can see it if I manually add unreleased safari version to the "browserslist" field:

In Webpack mode:

[modular] Could not find esbuild equivalent for safari TP

...

./src/index.tsx
Error: Transform failed with 1 error:
error: Invalid version: "TP"

In ESBuild mode

[modular] Could not find esbuild equivalent for safari TP
[modular] Failed to compile.
[modular]
[modular] This is a bad error ... lol
[modular]
[modular] Failed to compile.
[modular]
[modular] This is a bad error ... lol
[modular]
[modular] Failed to compile
LukeSheard wrote this answer on 2021-11-13

The first error is definitely correct - I suspect that we need to tidy up the error handling in formatError to deal with errors which do not have a file location. I think if we exposed the whole error it would be the same under the hood.

cristiano-belloni wrote this answer on 2021-11-15

The first error is definitely correct - I suspect that we need to tidy up the error handling in formatError to deal with errors which do not have a file location. I think if we exposed the whole error it would be the same under the hood.

Agree. I'm looking at that right now.. I guess we also should stop at the first error and not show "Failed to compile" three times.

cristiano-belloni wrote this answer on 2021-11-15

Fixed in #1050

🤔
Didn't find what you were looking for ?
Create your own issue
More Details About Repo
Owner Name jpmorganchase
Repo Name modular
Full Name jpmorganchase/modular
Language TypeScript
Created Date 2020-05-21
Updated Date 2022-01-15
Star Count 538
Watcher Count 18
Fork Count 28
Issue Count 34

YOU MAY BE INTERESTED

Issue Title State Comments Created Date Updated Date Closed Date