TypeError: ...: Duplicate declaration "t" #100
Comments
What's your babel config? |
Hi Chadkin, it is: {
"presets": ["@babel/preset-env", "@babel/preset-react"],
} |
Try to remove typescript plugin |
If I remove typescript plugin, error will be threw when rollup transpile typescript code. |
Commonjs cannot parse typescript code so it can't be run before typescript plugin. Could you please create a repository with reproduction. It's hard to guess without all information. |
Okay, I will back with a repo. |
I finished a simple demo, it works fine! |
Hi @TrySound , You can go to /test folder, run I'm trying to remove parts of the source code to find out which part is made failed. |
One of the reasons this may happen is very old plugins. All migrated to |
I have tried using following dependencies: "@rollup/plugin-babel": "^5.2.2",
"@rollup/plugin-commonjs": "^17.0.0",
"@rollup/plugin-typescript": "^8.1.0", unfortunately, still not working |
I figured this is a bug in terser itself. Raised a bug |
Hey, I thought I'd reply here instead of on the Terser repo. If the issue really is the code you pasted @TrySound then it might be a babel bug, however I couldn't get any error in the REPL. Because the output is valid ES code. The name export function Stave() {
const o = [];
for (const [t, n] of []) { // Here's a t (for scope)
const t = true; // And here's a t (scope of the block in for)
o.push(t);
}
} |
Unused variable is also valid in js. Eslint may not be installed in the project. |
Ah, right. It works. Weird then. I didn't find any other duplicated |
What is the JavaScript running on? Safari needs the safari10 option to run properly in some cases. |
Hi guys,
My library is built successfully but got an error when min.js file to be used (non-minified is work fine), for instance:
My package.json:
My rollup config:
I have tried "rollup-plugin-uglify-es" but it isn't work.
The text was updated successfully, but these errors were encountered: