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
The swc package is encountering an error during the minification process when handling specific input with an accompanying sourcemap. The error message is as follows:
[Error: invalid type: map, expected a string at line 1 column 3155233] {
code: 'InvalidArg'
}
Background
I'm trying to speed up production builds of ember.js applications by trying to move from terser to swc for minification.
Reproduction
While minification seems to work fine with swc, working with sourcemaps does not. For this issue I created a new (empty) Ember.js application. Since the payloads are relatively large, I've set up a public repository showcasing the issue: swc-minify-crash-demo.
terser
Please note that terser works properly on the given input. A demo is also included in the repository.
The minifier exits properly with minified code and an accompanying source map.
Actual behavior
swc crashes with the following error:
[Error: invalid type: map, expected a string at line 1 column 3155233] {
code: 'InvalidArg'
}
Version
1.3.100
Additional context
Happy to help with debugging, but I don't know where to start. I did try to start the script with SWC_DEBUG=1 node swc.mjs, but that did not lead to additional output.
The text was updated successfully, but these errors were encountered:
**Description:**
- This PR fixes the source map generation when `inputSourceMap` is specified.
- This PR fixes `minify()` not accepting parsed source map in the option.
**Related issue:**
- Closes#8372.
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Describe the bug
Bug Summary
The swc package is encountering an error during the minification process when handling specific input with an accompanying sourcemap. The error message is as follows:
Background
I'm trying to speed up production builds of ember.js applications by trying to move from terser to swc for minification.
Reproduction
While minification seems to work fine with swc, working with sourcemaps does not. For this issue I created a new (empty) Ember.js application. Since the payloads are relatively large, I've set up a public repository showcasing the issue: swc-minify-crash-demo.
terser
Please note that terser works properly on the given input. A demo is also included in the repository.
Input code
Can be found on GitHub: vendor-4d35fc8b803beec7d53591943a61d748.js.
Config
.swcrc: N/A
minify
options can be found on GitHub: vendor-4d35fc8b803beec7d53591943a61d748.jsonPlayground link (or link to the minimal reproduction)
https://github.com/Frank3K/swc-minify-crash-demo
SWC Info output
Expected behavior
The minifier exits properly with minified code and an accompanying source map.
Actual behavior
swc crashes with the following error:
Version
1.3.100
Additional context
Happy to help with debugging, but I don't know where to start. I did try to start the script with
SWC_DEBUG=1 node swc.mjs
, but that did not lead to additional output.The text was updated successfully, but these errors were encountered: