You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reporter errors crash source-map formatting with Vite 8.3.5 (code.charCodeAt) #11682
ServerModuleRunner uses readFile(result.tmp), returning a Buffer where Vite expects source text. Changing it to readFile(result.tmp, 'utf-8') fixes the standalone reproduction. Vite 8.3.4 also avoids the crash in our integration tests.
System Info
macOS arm64; Node 26.2.0; Vitest 5.0.5; Vite 8.3.5.
Used Package Manager
yarn
Reacted by Fabricius Seifert and Juan Pablo Romero Mendoza
Can confirm on Linux (Node 24) as well. The Buffer only started breaking with vitejs/vite#23775, which now calls code.charCodeAt on the fetched module, and the other result.tmp readers already pass 'utf-8', so the one call in serverRunner.ts is the only place that needs the change.
I'm happy to open a PR with the fix and a regression test once this is approved, unless @juan-fernandez would like to send it since they found it.
Same root cause, different symptom, in case it helps triage: with vite 8.3.5 a globalSetup that imports aws-cdk-lib (stack trace capture) makes the whole run fail with TypeError: code.charCodeAt is not a function and "No test files found", so no test runs at all, not only the reporter output. In our run the modules with a Buffer as meta.code were exactly those that go through the result.tmp path (globalSetup and the CDK app files). Changing the call to readFile(result.tmp, "utf-8") fixes it: 252 files / 3196 tests pass with vitest 5.0.5 + vite 8.3.5; vite 8.3.4 is a workaround.
This issue is approved, so the team accepts a pull request for it. To work on it, open a pull request against main and link this issue in its description with a closing keyword, for example Fixes #11682.
The team accepts one pull request per issue: if another pull request for this issue is already open, a new one is closed automatically. See our pull request policy for more context.
Activity
masonliiu commentedon Oct 21, 2026
Can confirm on Linux (Node 24) as well. The Buffer only started breaking with vitejs/vite#23775, which now calls
code.charCodeAton the fetched module, and the otherresult.tmpreaders already pass'utf-8', so the one call inserverRunner.tsis the only place that needs the change.I'm happy to open a PR with the fix and a regression test once this is approved, unless @juan-fernandez would like to send it since they found it.
juan-fernandez commentedon Oct 21, 2026
unless maintainers approve the issue it's not possible to contribute a fix. I'm waiting for their approval 😄
ci: narrow the vitest ignore to the affected releases
ci: skip vitest <=5.0.5 in Dependabot (#217)
deadratfink commentedon Oct 22, 2026
Same root cause, different symptom, in case it helps triage: with vite 8.3.5 a
globalSetupthat importsaws-cdk-lib(stack trace capture) makes the whole run fail withTypeError: code.charCodeAt is not a functionand "No test files found", so no test runs at all, not only the reporter output. In our run the modules with aBufferasmeta.codewere exactly those that go through theresult.tmppath (globalSetupand the CDK app files). Changing the call toreadFile(result.tmp, "utf-8")fixes it: 252 files / 3196 tests pass with vitest 5.0.5 + vite 8.3.5; vite 8.3.4 is a workaround.fix(deps): hold Vite at 8.3.4 until Vitest fixes vitest#11682
github-actions commentedon Oct 22, 2026
This issue is approved, so the team accepts a pull request for it. To work on it, open a pull request against
mainand link this issue in its description with a closing keyword, for exampleFixes #11682.The team accepts one pull request per issue: if another pull request for this issue is already open, a new one is closed automatically. See our pull request policy for more context.
fix: read cached source as utf-8 (fix vitest-dev#11682) (vitest-dev#1…
fix(deps): keep vite at 8.3.4 in the backend until vitest fixes the g…
fix(deps): keep vite at 8.3.4 in the backend until vitest fixes the g…
chore: prepare for nest-server 12.0.0, type-aware lint, dependency ma…
build(deps-dev): routine updates holding Vite and tsdown (#102)
chore(deps): move the Vitest peer to Vite 8.3.4
build(deps): keep vite on 8.3.4 until vitest ships its Buffer fix
chore(deps): apply routine updates from #114 without vite and tsdown (#…
fix(wasm): pin vite to 8.3.4 so reporter errors stay visible under vi…
chore(deps): move vitest 5.0.5 -> 5.1.0 to fix module-runner crash
12.3.0: Security hardening for Better-Auth, AI and MCP, tenant data p…