-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Open
Labels
Description
Describe the bug
Yet another very minor stack trace issue. It's likely due to "use strict" appended on runtime side evaluation. Recording it here so I have a place to point to for one test failure on oxc module runner vitejs#85.
- repro3.js
throw new Error('__TEST__')- vite2.js
import { createServerModuleRunner } from "vite";
import { createServer } from "vite";
async function main() {
const server = await createServer({ configFile: false})
const runner = createServerModuleRunner(server.environments.ssr, {
// same issues for any interceptor
sourcemapInterceptor: "prepareStackTrace"
});
await runner.import(process.argv[2]);
}
main()On Node:
$ node repro3.js
file:///dir/repro3.js:1
throw new Error('__TEST__')
^
Error: __TEST__
at file:///dir/repro3.js:1:7On Vite:
$ node vite2.js repro3.js
[vite] connected.
/dir/repro3.js:3 <-- ❓ (probably rewriting this is not supported or node's bug)
"use strict";throw new Error('__TEST__')
^
Error: __TEST__
at /dir/repro3.js:1:18 <-- ❓❓Reproduction
Steps to reproduce
Download stackblitz and test it locally
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.1 => 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.