Git Product home page Git Product logo

Comments (32)

zxch3n avatar zxch3n commented on September 8, 2024 1

The source map error can be safely ignored. Sorry, but I don't know why it cannot find the test suite. I cannot reproduce this error on my Windows machine. If you're interested, contributions are welcome

from vscode.

xon52 avatar xon52 commented on September 8, 2024 1

I will keep digging but running the extension locally I can get it to work I think
image

But very interestingly when I run the tests in debug mode:
The tests fail with the familiar text:
image

And in the terminal, the first error appears as before Could not read source map for file... but the tests parse 🤔 :
image

from vscode.

xon52 avatar xon52 commented on September 8, 2024 1

@mengqianyixing @zxch3n are either of you using nvm?
I am and I wonder if that's at all a contributor?

from vscode.

Aaron-Pool avatar Aaron-Pool commented on September 8, 2024

@mengqianyixing

I got this when I first tried to use the extension as well. The solution for me was to use the following setting to have my package manager run the test instead of whatever the extension was trying to do to locate the correct command:

image

In my case, pnpm vitest was the correct setting. But yours may be different, depending on the package manager you're using and what it's cli is for using installed binaries.

from vscode.

xon52 avatar xon52 commented on September 8, 2024

pnpm didn't help; I'm still having this error.

Not sure if this debugging helps:
image

from vscode.

mengqianyixing avatar mengqianyixing commented on September 8, 2024

@mengqianyixing

I got this when I first tried to use the extension as well. The solution for me was to use the following setting to have my package manager run the test instead of whatever the extension was trying to do to locate the correct command:

image

In my case, pnpm vitest was the correct setting. But yours may be different, depending on the package manager you're using and what it's cli is for using installed binaries.

it's still not work by use 'pnpm vitest', look like the "vitest" it's not good support for the windows. :)

from vscode.

Aaron-Pool avatar Aaron-Pool commented on September 8, 2024

@mengqianyixing
I got this when I first tried to use the extension as well. The solution for me was to use the following setting to have my package manager run the test instead of whatever the extension was trying to do to locate the correct command:
image
In my case, pnpm vitest was the correct setting. But yours may be different, depending on the package manager you're using and what it's cli is for using installed binaries.

it's still not work by use 'pnpm vitest', look like the "vitest" it's not good support for the windows. :)

For what it's worth, I'm on windows as well. And it's working for me. So I'm guessing windows isn't the root of your problem.

from vscode.

zxch3n avatar zxch3n commented on September 8, 2024

@mengqianyixing Is this still happening on v0.1.17?

from vscode.

AlmarAubel avatar AlmarAubel commented on September 8, 2024

We still have the problem in v0.1.17 (On windows, with NPM)

from vscode.

zxch3n avatar zxch3n commented on September 8, 2024

@AlmarAubel Is your env.PATH equal to undefined as well? If so, how about setting vitest.nodeEnv to {PATH: "/path/to/node"}

from vscode.

AlmarAubel avatar AlmarAubel commented on September 8, 2024

yes env.PATH: undefined

Tried to set vitest.nodeEnv to "vitest.nodeEnv": {"PATH":"C:\Program Files\nodejs\" }. But keep having the same error.
When i debug a test I get this error:

Some breakpoints might not work in your version of Node.js. We recommend upgrading for the latest bug, performance, and security fixes. Details: [https://aka.ms/AAcsvqm]()
"[C:\Program]() Files\nodejs\node.exe" [.\node_modules\vitest\vitest.mjs]() run /source/xxxxx/AdresField.test.ts --testNamePattern "Adressfield should render" --reporter=default --reporter=json --outputFile [C:\Users\Almar\AppData\Local\Temp\vitest-report-4m0912.json]()
 RUN  v0.9.3 [c:/source/xxxx]()
node_modules/vitest/dist/chunk-vite-node-externalize.9aaddc2d.js:13008

Could not read source map for [file:///c:/source/xxxxx/@vite/env](): ENOENT: no such file or directory, open '[c:\source\xxxx\]()@vite\env.mjs.map'

This give me the same error "vitest.nodeEnv": {"PATH":"C:\Program Files\nodejs\node.exe" }

from vscode.

zxch3n avatar zxch3n commented on September 8, 2024

@AlmarAubel Can you try "vitest.nodeEnv": {"PATH":"C:\\Program Files\\nodejs\\" }

from vscode.

AlmarAubel avatar AlmarAubel commented on September 8, 2024

Still the Same error.

Don't have much time today if you like I could debug and try to make a PR later this week to fix this issue for windows.

Running the command from the error message directly in the terminal give no errors:
node c:\source\xxxx\node_modules\vitest\vitest.mjs /source/xxxxx/libs/shared/src/components/form-elements/AdresField/AdresField.test.ts --reporter=json --reporter=verbose --outputFile "C:/Users/xxx/AppData/Local/Temp/vitest-report-ggr50.json" --run -t Adressfield

from vscode.

zxch3n avatar zxch3n commented on September 8, 2024

Thanks! @AlmarAubel

from vscode.

zxch3n avatar zxch3n commented on September 8, 2024

Is this still happening on v0.1.18? @mengqianyixing @xon52

from vscode.

xon52 avatar xon52 commented on September 8, 2024

@zxch3n same error with additional lines in blue:
image

from vscode.

zxch3n avatar zxch3n commented on September 8, 2024

@xon52 this looks like another issue. Do you use a dynamic test name or it.each in AnimatedLetter.test.ts?

Have you met the error with Vitest should be configured to be able to run from project root?

from vscode.

xon52 avatar xon52 commented on September 8, 2024

I get this for all my tests, and no, nothing fancy at all. This has never worked, even boilerplate.

If I run vitest from the normal script method in the terminal it works fine.

from vscode.

zxch3n avatar zxch3n commented on September 8, 2024

@xon52 If you run the test with the plugin, would you see an error like this one?
image

from vscode.

xon52 avatar xon52 commented on September 8, 2024

All green from terminal/script method:
image

Exact same error as before:
image

from vscode.

zxch3n avatar zxch3n commented on September 8, 2024

@AlmarAubel Hi, can you debug successfully? I wonder whether you have met the same problem.

@xon52 yes, I use nvm. But I'm not sure what's the course of debugging result not found error.

I am and I wonder if that's at all a contributor?

Sorry, I don't know what you mean here

from vscode.

xon52 avatar xon52 commented on September 8, 2024

Oh ok. I was wondering if there was something strange with the Node path because of nvm.

And I meant cause contributor not GitHub contributor 😅 Sorry! I will try explore more later. Do you use Discord? I couldn't find you. Add me on there if you want to chat more easily about this: xon52#5557

from vscode.

AlmarAubel avatar AlmarAubel commented on September 8, 2024

I believe my PR will fix this issue (at least at my machine ;)) @zxch3n can you verify that it's also working on your machine?

Otherwhise we have to change the comparison so it’s not case sensitive on windows when comparing file paths

from vscode.

AlmarAubel avatar AlmarAubel commented on September 8, 2024

@xon52 could you check should be fixed in v0.1.18

from vscode.

xon52 avatar xon52 commented on September 8, 2024

@AlmarAubel still not working for me. I did fix normal Run mode with this Draft PR: #24
But I haven't finished on the Debug mode.

Please could you pull and test if it works on your machine?

from vscode.

AlmarAubel avatar AlmarAubel commented on September 8, 2024

Did you still have de node env setting set in your workspace settings?

from vscode.

xon52 avatar xon52 commented on September 8, 2024

from vscode.

hhsl avatar hhsl commented on September 8, 2024

Hey, I experienced "( Vitest should be configured to be able to run from project root )" on macOS as well. What helped in my case was running VSCode from the project root (code .). For example running VSCode from an app launcher provokes the error again.

Maybe this helps :)

from vscode.

darkgrayknight avatar darkgrayknight commented on September 8, 2024

I am also getting this error in debug, though it passes, the test keeps running and doesn't complete. If I get it to stop, it shows it passed.

"C:\Program Files\WindowsPowerShell\Modules\nvm\2.5.1\vs\v16.14.2\node.exe" .\node_modules\vitest\vitest.mjs run tests/Basic.spec.tsx --testNamePattern "Test Basic" --reporter=default --reporter=json --outputFile C:/Users/USER/AppData/Local/Temp/vitest-report-hpuz2.json RUN v0.9.3 c:/Users/USER/source/repos/REPO node_modules/vitest/dist/chunk-vite-node-externalize.9aaddc2d.js:13008 Could not read source map for file:///c:/Users/USER/source/repos/REPO/@vite/env: ENOENT: no such file or directory, open 'c:\Users\USER\source\repos\REPO\@vite\env.mjs.map' √ tests/input/Basic.spec.tsx (15 tests | 14 skipped) 615ms node_modules/vitest/dist/chunk-vite-node-externalize.9aaddc2d.js:13008 Test Files 1 passed (1) node_modules/vitest/dist/chunk-vite-node-externalize.9aaddc2d.js:13008 Tests 1 passed | 14 skipped (15) node_modules/vitest/dist/chunk-vite-node-externalize.9aaddc2d.js:13008 Time 27.05s (in thread 615ms, 4398.58%) node_modules/vitest/dist/chunk-vite-node-externalize.9aaddc2d.js:13008 JSON report written to C:/Users/USER/AppData/Local/Temp/vitest-report-hpuz2.json node_modules/vitest/dist/chunk-vite-node-externalize.9aaddc2d.js:13008 close timed out after 1000ms

from vscode.

itpropro avatar itpropro commented on September 8, 2024

I have the same problem as described by @darkgrayknight when I use the debugging functionality in the VSCode extension. In addition, this is the underlying error:

Error: Cannot find module 'vite'
Require stack:
- e:\repos\project\vite.config.js
- E:\repos\project\node_modules\.pnpm\[email protected]\node_modules\vite\dist\node\chunks\dep-8f5c9290.js
- E:\repos\project\node_modules\.pnpm\[email protected]\node_modules\vite\dist\node\index.js
    at Function.Module._resolveFilename (e:\repos\project\lib\internal\modules\cjs\loader.js:933:15)
    at Function.Module._load (e:\repos\project\lib\internal\modules\cjs\loader.js:778:27)
    at Module.require (e:\repos\project\lib\internal\modules\cjs\loader.js:1005:19)
    at require (e:\repos\project\lib\internal\modules\cjs\helpers.js:102:18)
    at Object.<anonymous> (e:\repos\project\vite.config.js:25:19)
    at Module._compile (e:\repos\project\lib\internal\modules\cjs\loader.js:1105:14)
    at Object.require.extensions.<computed> [as .js] (E:\repos\project\node_modules\.pnpm\[email protected]\node_modules\vite\dist\node\chunks\dep-8f5c9290.js:61963:20)
    at Module.load (e:\repos\project\lib\internal\modules\cjs\loader.js:981:32)
    at Function.Module._load (e:\repos\project\lib\internal\modules\cjs\loader.js:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {code: 'MODULE_NOT_FOUND', requireStack: Array(3), stack: 'Error: Cannot find module 'vite'
Require stac…re (node:internal/modules/cjs/loader:1005:19)', message: 'Cannot find module 'vite'
Require stack:
- e…@2.9.12\node_modules\vite\dist\node\index.js'}

Maybe you can look into this and reopen the issue in the meanwhile @zxch3n ?
Thank you!

from vscode.

zxch3n avatar zxch3n commented on September 8, 2024

@itpropro I publish a new version to pre-release just now, v0.2.18. Can you check whether this is still happening?

from vscode.

itpropro avatar itpropro commented on September 8, 2024

@itpropro I publish a new version to pre-release just now, v0.2.18. Can you check whether this is still happening?

All my problems are fixed since 2.16/17, thanks for the effort :)

from vscode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.