Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[workaround found] Vague error - error with no location #6986

Open
6 tasks done
sanjarcode opened this issue Nov 29, 2024 · 7 comments
Open
6 tasks done

[workaround found] Vague error - error with no location #6986

sanjarcode opened this issue Nov 29, 2024 · 7 comments

Comments

@sanjarcode
Copy link

sanjarcode commented Nov 29, 2024

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

Copy link

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
Copy link

Botuca commented Nov 29, 2024

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 using Vue 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
Copy link

LitenApe commented Nov 29, 2024

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

dperini/nwsapi#135

@sheremet-va
Copy link
Member

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

@CreeTar
Copy link

CreeTar commented Dec 2, 2024

I have this same issue after updating to JSDOM v25 due to the punycode warning from it's tough-cookie dependency. Now all my vitest-unit tests using vue testutils are not working anymore with the same error message. The error is thrown in the jsdom-package when a selector is called, for me it's this line of code: mountedComponent.getComponent(VTextField).get('label');
Techstack is Vue3, Vuetify, Vite

@pratyakash
Copy link

I am also facing the same kind of Error with Next JS 14 and Vitest

@sanjarcode sanjarcode changed the title Vague error - error with no location [workaround found] Vague error - error with no location Dec 3, 2024
@sanjarcode
Copy link
Author

sanjarcode commented Dec 3, 2024

Turns out the problem is with jsdom, or atleast u can fix it by patching it.

Patch (1 line of code): jsdom/jsdom#3797

The error goes away after this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants