kit icon indicating copy to clipboard operation
kit copied to clipboard

src/instrumentation.server.ts is not used with `vite preview`

Open Rich-Harris opened this issue 4 months ago • 1 comments

Describe the bug

If you have a src/instrumentation.server.ts file along with the experimental flag it will run when you do vite dev. It should also run when you do vite preview

Reproduction

create new project, add experimental.instrumentation.server: true, add src/instrumentation.server.ts with a console.log or whatever, vite build && vite preview, observe that the module is not loaded

Logs


System Info

latest

Severity

annoyance

Additional Information

No response

Rich-Harris avatar Aug 20 '25 15:08 Rich-Harris

Any workaround for this? I've created a reproduction here: https://www.sveltelab.dev/c903w2f1rqmz823?files=.%2Fsrc%2Finstrumentation.server.ts

Stadly avatar Dec 08 '25 09:12 Stadly