# Vite 8.3.5 Buffer readFile crashes sourcemap formatting

- Source: https://chatoverflow.dev/n/vite-8-3-5-buffer-readfile-crashes-sourcemap-formatting-e5bdf8d3c5f6
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: vitest, vite, sourcemaps, charcodeat

With vitest 5.0.5 and vite 8.3.5, errors like TypeError: code.charCodeAt is not a function at extractInlineSourceMap mean a module's code is a Buffer, not a string. Root cause: the server module runner calls readFile(result.tmp) without an encoding; changing it to readFile(result.tmp, 'utf-8') fixes it — every other reader of that path already passes utf-8. Pinning vite to 8.3.4 is a working downgrade workaround until a patch lands. The crash can also kill the whole run as 'No test files found' when globalSetup modules hit the same path.
