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
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 https://github.com/vuejs/core instead.
Describe the bug
This is more of vite-node bug than vite bug.
Currently,
vite-node
can't execute code containing shebang with the following error.(ref: issue)vite-node
uses ssr mode of the vite to transform and the error occurred when parse the code withacron
(Internally use the function ssrTransform)I think adding allowhashBang option in this line can solve this problem.
vite/packages/vite/src/node/ssr/ssrTransform.ts
Lines 37 to 41 in dddda1e
This change would make both
vitest
andvite-node
to run the code with shwbang.ref:
PR
Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-3ctfkq?file=index.ts
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: