-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Closed
Labels
feat: deps optimizerEsbuild Dependencies OptimizationEsbuild Dependencies Optimizationp3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)regressionThe issue only appears after a new releaseThe issue only appears after a new release
Description
Describe the bug
import { createServer } from 'vite';
process.on('beforeExit', (code) => {
console.log(code);
});
const server = await createServer({
appType: 'spa',
base: '/',
});
const result = await server.transformRequest('./entry.js');
const module = server.moduleGraph.getModuleById('./entry.js');
console.log('result', result);
console.log('module', module);
await server.close();In vite 5, exit code is 0, in vite 6, it's 13
Reproduction
https://stackblitz.com/edit/stackblitz-starters-3b36p6?file=index.js
Steps to reproduce
node index.js
System Info
npx envinfo --system --npmPackages '{vite,@vitejs/*,rollup}' --binaries --browsers
Need to install the following packages:
[email protected]
Ok to proceed? (y) y
System:
OS: macOS 15.1.1
CPU: (16) arm64 Apple M4 Max
Memory: 18.58 GB / 128.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.18.0 - ~/.local/state/fnm_multishells/12350_1732795121691/bin/node
Yarn: 1.22.22 - ~/.local/state/fnm_multishells/12350_1732795121691/bin/yarn
npm: 10.8.2 - ~/.local/state/fnm_multishells/12350_1732795121691/bin/npm
pnpm: 9.14.2 - ~/.local/state/fnm_multishells/12350_1732795121691/bin/pnpm
Browsers:
Chrome: 131.0.6778.86
Safari: 18.1.1
npmPackages:
vite: 6.0.1 => 6.0.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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feat: deps optimizerEsbuild Dependencies OptimizationEsbuild Dependencies Optimizationp3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)regressionThe issue only appears after a new releaseThe issue only appears after a new release