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
Duplicate Identifier in generated output #800
Comments
This bug surprised me! The reason for this is that Terser turns function declarations in I got the repro down to:
|
A fix has been pushed, which will be released tomorrow. |
I think there's another cases where this happens, but I can't seem to narrow it down. Running Terser (4.8 or 5.3) on this file causes the first imported identifier to become https://unpkg.com/@emotion/styled-base@10.0.31/dist/styled-base.esm.js import e from"/@npm/@babel/runtime/helpers/defineProperty";
// ...
export default function e(t,p){ // ... |
Reopening for investigation, thanks @developit |
@developit it's a variation on the previous issue :) an Minimal repro:
Once the function expression with the name |
Bug report
Version (5.2.1)
terser --module --compress --mangle -- ./input.js > output.js
terser
inputterser
output or errorExpected result
In the output js, there is a
let n
and a functionn
. When loaded in browser as a module, it lead to this error:output.js:formatted:1 Uncaught SyntaxError: Identifier 'n' has already been declared
.The text was updated successfully, but these errors were encountered: