-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Closed
Labels
feat: sourcemapSourcemap supportSourcemap supportp3-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
In the vitejs 5.0.12 documentation it was mentioned that environment variables would be replaced with undefined if they didn't exist, what I didn't expect was that this made sourcemap invalid. Maybe this is a feature rather than a bug. If that's the case, then I think it should be mentioned in the documentation, this saves developers time in locating problems.
Reproduction
https://stackblitz.com/edit/vitejs-vite-om3cbj?file=README.md&terminal=dev
Steps to reproduce
- open the project using vscode
npm run build:env-sourcemap
- add a breakpoint in the ./src/env-not-exist.ts file
- open vscode javascript debugging terminal
node ./dist/env-not-exist.cjs
- breakpoint not in effect
- repeat the above steps in ./dist/ env-existence.cjs and./src/env-exist.ts, no problem
System Info
System:
OS: macOS 13.0
CPU: (8) arm64 Apple M1
Memory: 63.05 MB / 8.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.18.0 - ~/.nvm/versions/node/v16.18.0/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 8.19.4 - ~/.nvm/versions/node/v16.18.0/bin/npm
pnpm: 8.10.2 - ~/.nvm/versions/node/v16.18.0/bin/pnpm
Browsers:
Safari: 16.1
npmPackages:
@vitejs/plugin-vue: ^4.5.2 => 4.6.2
Used 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: sourcemapSourcemap supportSourcemap supportp3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)