Vitest ui throws SyntaxError when starting
See original GitHub issueDescribe the bug
An error occurred when upgrading to the latest version of vitest and starting the vitest -ui
.
Uncaught SyntaxError: Unexpected token '-'

Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-peyoui?file=test%2Fbasic.test.ts
System Info
System:
OS: macOS 12.0.1
CPU: (8) x64 Intel(R) Core(TM) i7-1068NG7 CPU @ 2.30GHz
Memory: 190.04 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.15.0 - ~/.nvm/versions/node/v16.15.0/bin/node
npm: 8.5.5 - ~/.nvm/versions/node/v16.15.0/bin/npm
Browsers:
Chrome: 98.0.4758.102
Chrome Canary: 103.0.5048.0
Edge: 97.0.1072.55
Firefox: 100.0.2
Safari: 15.1
npmPackages:
vite: latest => 2.9.9
vitest: 0.13.0 => 0.13.0
Used Package Manager
npm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:9 (9 by maintainers)
Top Results From Across the Web
run vitest ui Error · Issue #1548 - GitHub
Describe the bug When running the vitest --ui command, open the http://localhost:51205 the browser and throw an error Uncaught SyntaxError: ...
Read more >Syntax error when using vitest on my component test
I created a test to test the working of one of my buttons designed in solidjs using vitest and solid-testing-library . Here is...
Read more >unexpected token 'export' at object.compilefunction (node:vm ...
Our team is getting an export syntax error only when running the mocha tests after including a particular library (Bryntum Scheduler in this...
Read more >SyntaxError: missing ) after argument list - JavaScript | MDN
The JavaScript exception "missing ) after argument list" occurs when there is an error with how a function is called. This might be...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
it should be an bug about
esbuild
, which has been fixed. https://github.com/evanw/esbuild/commit/f7981183b9a0b841e848f5304a76def55cb2cb9bI got the same bug, it seems to be introduced by 12.10 (It works on 12.9 and below, and stop working on 12.10 and 13.0)
I’m taking a look right now. (I’ll do a PR if I find anything)