Instrumenting vite build causes thrown error #337
Replies: 7 comments 1 reply
-
Hello @petertellgren, as this seems like it is an issue in babel or in instanbul-lib-instrument as it is the code transforming and adding the necessary instrumentation. This package merely interfaces it to Vite. I unfortunately cannot debug this myself or make a fix for it, So it would be better if you posted the issue for the correct package if you can conclude if it is babel or some other package where the error originates. |
Beta Was this translation helpful? Give feedback.
-
I guess there's something wrong with |
Beta Was this translation helpful? Give feedback.
-
I have the same issue after update to vite 6. Standard build without instrumentation works without any problem. However, once I add instrumentation it fails on the first enum in the codebase. |
Beta Was this translation helpful? Give feedback.
-
This issue started for me in late december when vite updated to 6.0.5, however downgrading vite to 6.0.4 did not fix it. If you run the example above with "VITE_COVERAGE=false" the error is fixed, so it absolutely is connected to istanbul or this plugin. Can we at least move this to a discussion instead of just closing the bug? |
Beta Was this translation helpful? Give feedback.
-
@sirphoenix Sure thing, moving to a discussion. |
Beta Was this translation helpful? Give feedback.
-
Hello guys, I have a (workaround) solution. It is caused by |
Beta Was this translation helpful? Give feedback.
-
Opened up a bug in rollup: rollup/rollup#5815 |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
While building a instrumented version of the vite app with the plugin, the resulting JS code contains a uncaught TypeError if the typescript source code contains an enum.
Reproduction
https://stackblitz.com/edit/vitejs-vite-vxbpagry
Steps to reproduce
Run
npm install
followed bynpm run build
andnpm run preview
open console and see the error:
The app does not run due to the error thrown
The app runs fine in dev mode using
npm run dev
System Info
Used Package Manager
npm
Logs
No response
Validations
Beta Was this translation helpful? Give feedback.
All reactions