Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vite 6 breaks the simple transformRequest #18824

Closed
7 tasks done
himself65 opened this issue Nov 28, 2024 · 0 comments · Fixed by #18826
Closed
7 tasks done

vite 6 breaks the simple transformRequest #18824

himself65 opened this issue Nov 28, 2024 · 0 comments · Fixed by #18826
Labels
feat: deps optimizer Esbuild Dependencies Optimization p3-minor-bug An edge case that only affects very specific usage (priority) regression The issue only appears after a new release

Comments

@himself65
Copy link

himself65 commented Nov 28, 2024

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.1

Used Package Manager

npm

Logs

No response

Validations

@sapphi-red sapphi-red added p3-minor-bug An edge case that only affects very specific usage (priority) regression The issue only appears after a new release feat: deps optimizer Esbuild Dependencies Optimization labels Nov 29, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Dec 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feat: deps optimizer Esbuild Dependencies Optimization p3-minor-bug An edge case that only affects very specific usage (priority) regression The issue only appears after a new release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants