-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Open
Labels
feat: ssrp2-edge-caseBug, but has workaround or limited in scope (priority)Bug, but has workaround or limited in scope (priority)regressionThe issue only appears after a new releaseThe issue only appears after a new release
Description
Describe the bug
Example code test.js
import { join } from "node:path";
import { join } from "node:path";
export default join("a", "b")On Node:
❯ node src/test.js
SyntaxError: Identifier 'join' has already been declared (2:9)
at ModuleLoader.moduleStrategy (https://kkvilbvzkqgithub-l0as.w-credentialless-staticblitz.com/builtins.8cb5228f.js:160:2071)
at ModuleLoader.<anonymous> (https://kkvilbvzkqgithub-l0as.w-credentialless-staticblitz.com/builtins.8cb5228f.js:154:2546)
at async https://kkvilbvzkqgithub-l0as.w-credentialless-staticblitz.com/builtins.8cb5228f.js:155:924
Node.js v18.20.3On Vite SSR:
❯ node repro.js
[Module: null prototype] { default: 'a/b' }I noticed this when testing oxc module runner transform in vitejs#85 where oxc rejected such code but current ssr tolerate the same code.
Reproduction
Steps to reproduce
Open stackblitz and run node repro.js and node src/test.js
System Info
System:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 18.20.3 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.2.3 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
npmPackages:
vite: ^6.2.0 => 6.2.1Used Package Manager
npm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- 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 vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Metadata
Metadata
Assignees
Labels
feat: ssrp2-edge-caseBug, but has workaround or limited in scope (priority)Bug, but has workaround or limited in scope (priority)regressionThe issue only appears after a new releaseThe issue only appears after a new release