You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi guys. I use webpack swc-loader + browserslist with my stats query but swc fails to parse targets. I made a reproduction using swc cli
Here is an error
> [email protected] build
> swc --sync ./src/test.ts
thread '<unnamed>' panicked at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc_ecma_preset_env-0.207.1/src/lib.rs:49:60:
failed to parse targets: failed to convert target query to version data
Caused by:
0: failed to execute query
1: failed to resolve browserslist query: ["last 4 chrome version", "last 4 firefox version", "last 4 edge version", ">= 0.1% in my stats and last 2 years", "Firefox ESR", "not dead"]
2: failed to parse the rest of input: ...' stats and last 2 years, Firefox ESR, not dead'
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failed to handle: failed to parse targets: failed to convert target query to version data
Caused by:
0: failed to execute query
1: failed to resolve browserslist query: ["last 4 chrome version", "last 4 firefox version", "last 4 edge version", ">= 0.1% in my stats and last 2 years", "Firefox ESR", "not dead"]
2: failed to parse the rest of input: ...' stats and last 2 years, Firefox ESR, not dead'
Error: Failed to compile 1 file with swc.
at Object.assertCompilationResult (/Users/master/Projects/swc-browserslist-issue/node_modules/@swc/cli/lib/swc/util.js:164:15)
at files (/Users/master/Projects/swc-browserslist-issue/node_modules/@swc/cli/lib/swc/file.js:205:19)
at async _default (/Users/master/Projects/swc-browserslist-issue/node_modules/@swc/cli/lib/swc/file.js:224:9)
Describe the bug
Hi guys. I use webpack swc-loader + browserslist with my stats query but swc fails to parse targets. I made a reproduction using swc cli
Here is an error
Input code
No response
Config
Playground link (or link to the minimal reproduction)
https://github.com/taras-turchenko-moc/swc-browserslist-issue
SWC Info output
Also issue reproduces on
node:20.10.0-bullseye
docker image with amd archExpected behavior
SWC builds code with targets support based on my browsers usage
Actual behavior
No response
Version
@swc/core: 1.5.7
Additional context
To reproduce:
npm install
npm run build
The text was updated successfully, but these errors were encountered: