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
Yes, I was aware of verbatimModuleSyntax, but the point of the issue is to show inconsistency between browser and non-browser mode.
Why does it work fine in non-browser mode, or it works in vite server by default, but only fails in vite browser mode?
It works in non-browser mode because Vitests runs tests in a relaxed sandbox environment where ESM rules are less strict then they should be. There will be a switch to run code in an actual environment in the future where your code will fail the same way: #7234
Describe the bug
This file runs successfully in standard vitest, but fails in vitest browser mode:
When running in browser mode, it prints this
Reproduction
Published a mini project here: https://github.com/just-boris/vitest-browser-typescript (not sure if browser mode can be used on StackBlitz)
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: