question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Vitest ui throws SyntaxError when starting

See original GitHub issue

Describe the bug

An error occurred when upgrading to the latest version of vitest and starting the vitest -ui.

Uncaught SyntaxError: Unexpected token '-'
image

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

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
nieyuyaocommented, May 31, 2022

it should be an bug about esbuild, which has been fixed. https://github.com/evanw/esbuild/commit/f7981183b9a0b841e848f5304a76def55cb2cb9b

1reaction
hugoattalcommented, May 30, 2022

I 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)

Read more comments on GitHub >

github_iconTop 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 >
Vitest UI | Guide
A blazing fast unit test framework powered by Vite.
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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found