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
✘ [ERROR] The symbol "el" has already been declared
html:/home/projects/vitejs-vite-kabw2t/index.html:8:12:
8 │ const el = document.createElement('span');
╵ ~~
The symbol "el" was originally declared here:
html:/home/projects/vitejs-vite-kabw2t/index.html:3:12:
3 │ const el = document.createElement('span');
╵ ~~
vite:resolve 0.80ms /main.js -> /home/projects/vitejs-vite-kabw2t/main.js +0ms
error when starting dev server:
Error: Build failed with 1 error:
html:/home/projects/vitejs-vite-kabw2t/index.html:8:12: ERROR: The symbol "el" has already been declared
at failureErrorWithLog (/home/projects/vitejs-vite-kabw2t/node_modules/esbuild/lib/main.js:1557:15)
at eval (/home/projects/vitejs-vite-kabw2t/node_modules/esbuild/lib/main.js:1215:28)
at runOnEndCallbacks (/home/projects/vitejs-vite-kabw2t/node_modules/esbuild/lib/main.js:1005:63)
at buildResponseToResult (/home/projects/vitejs-vite-kabw2t/node_modules/esbuild/lib/main.js:1213:7)
at eval (/home/projects/vitejs-vite-kabw2t/node_modules/esbuild/lib/main.js:1322:14)
at eval (/home/projects/vitejs-vite-kabw2t/node_modules/esbuild/lib/main.js:637:9)
at handleIncomingPacket (/home/projects/vitejs-vite-kabw2t/node_modules/esbuild/lib/main.js:734:9)
at Socket.readFromStdout (/home/projects/vitejs-vite-kabw2t/node_modules/esbuild/lib/main.js:604:7)
at Socket.EventEmitter.emit (https://vitejs-vite-kabw2t.w.staticblitz.com/blitz.05388ae171e3a0a12539f1efbda0fa1189d4f549.js:6:130023)
at addChunk (https://vitejs-vite-kabw2t.w.staticblitz.com/blitz.05388ae171e3a0a12539f1efbda0fa1189d4f549.js:6:526052)
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead.
Describe the bug
I have an entry html (such as index.html) like this:
I reused variable names between different module scripts, and then i ran vite and got an error:
This error will cause the devServer to fail to start. The current workaround is to not reuse variable names between html module scripts.
I think this is a bug, because if you access an html directly in the browser, you can use the same variable name in different module scripts.
Reproduction
https://stackblitz.com/edit/vitejs-vite-kabw2t?file=package.json&terminal=dev
System Info
System: OS: macOS 10.15.5 CPU: (8) x64 Intel(R) Core(TM) i7-8557U CPU @ 1.70GHz Memory: 201.05 MB / 16.00 GB Shell: 5.7.1 - /bin/zsh Binaries: Node: 14.4.0 - /usr/local/bin/node Yarn: 1.22.17 - /usr/local/bin/yarn npm: 6.14.4 - /usr/local/bin/npm Browsers: Chrome: 98.0.4758.80 Safari: 13.1.1 npmPackages: vite: ^2.7.2 => 2.8.0
Used Package Manager
npm
Logs
Validations
The text was updated successfully, but these errors were encountered: