-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Closed
Labels
feat: ssrp3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)
Description
Describe the bug
Error happened in a ssr vite react project while importing a json file as below:
index.tsx
import './test.json';test.json
{
"global": {
"name": "全局"
}
}The error message is :
rror when evaluating SSR module /src/test.json:
|- SyntaxError: Identifier 'global' has already been declared
at new AsyncFunction (<anonymous>)
Reproduction
Steps to reproduce
No response
System Info
System:
OS: macOS 13.5
CPU: (8) arm64 Apple M1
Memory: 173.59 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.11.1 - ~/.nvm/versions/node/v20.11.1/bin/node
Yarn: 1.22.19 - ~/.yarn/bin/yarn
npm: 10.2.4 - ~/.nvm/versions/node/v20.11.1/bin/npm
pnpm: 8.14.1 - /opt/homebrew/bin/pnpm
Browsers:
Brave Browser: 102.1.39.111
Chrome: 126.0.6478.127
Edge: 114.0.1823.37
Safari: 16.6Used 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: ssrp3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)