vitest-dev / vitest

Next generation testing framework powered by Vite.
https://vitest.dev
MIT License
13.18k stars 1.19k forks source link

Vague error - error with no location #6986

Open sanjarcode opened 3 days ago

sanjarcode commented 3 days ago

Describe the bug

An error is shown but the trace, or at least location of the error is not shown

Screenshot 2024-11-29 at 6 02 45 PM

TypeError: list.map is not a function OK, but where??

Reproduction

No repro, need to fix the error reporting sentence.

System Info

Mac, Vite, React

Used Package Manager

pnpm

Validations

github-actions[bot] commented 3 days ago

Hello @sanjarcode. Please provide a minimal reproduction using a GitHub repository or StackBlitz (you can also use examples). Issues marked with needs reproduction will be closed if they have no activity within 3 days.

Botuca commented 3 days ago

Hi @sanjarcode, I had the same issue today in the company's project. After debugging for a while, I managed to resolve it in two ways. My friend and colleague @elionaimelo helped me fix the problem.

In my project, I was usingVue version 3.5.12, Vitest version 2.0.5, and vue/coverage-v8 version 2.0.5 as well. After updating Vue to version 3.5.13 and updating both Vitest and vue/coverage-v8 to version 2.1.6, my project successfully ran the unit tests using the command npx vitest.

Another way to resolve the issue is to simply install the package @vue/server-renderer and keep the current versions of Vue and Vitest that you’re already using.

From what I understand, the new version of Vitest (2.1.6) now implicitly installs the @vue/server-renderer package, which is necessary for running unit tests correctly.

LitenApe commented 3 days ago

Just wanted to mention that this issue might be related JSDOM. JSDOM's dependency, nwsapi, was recently updated, and a similar issue appeared there, so it might be related

https://github.com/dperini/nwsapi/issues/135

sheremet-va commented 3 days ago

From what I understand, the new version of Vitest (2.1.6) now implicitly installs the @vue/server-renderer package, which is necessary for running unit tests correctly.

Vitest doesn't install any vue packages