Giter Site home page Giter Site logo

Comments (10)

gerhardcit avatar gerhardcit commented on August 15, 2024 2

I would suggest this is not a minor bug.
The same thing happens while running pnpm dev in sveltekit project and when hmr reloads a file eg:
src/routes/api/someroute/[id]/+page.server.ts

The extension crashes with an error saying: 'src/routes/api/someroute/[id]/+page.server.ts' is not available.
Then it just hangs. No way of resetting or restarting. The only way is to close vscode and reopen.
It's very annoying, and basically makes the extension unusable. So hence my suggestion this is NOT a minor bug.

You end up being stuck with spinner and "Resolving Vitest" and no way to "hard reset" or do something. Surely that must be an option?

Full output of the error:

Error: ENOENT: no such file or directory, open 'src/routes/app/someroute/[id]/+page.server.ts'
    at Object.readFileSync (node:fs:453:20)
    at createProxy (file:///project/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]_@types+node_kksg7dl7df63ve4rt7ijxpt6ti/node_modules/@sveltejs/kit/src/core/sync/write_types/index.js:519:31)
    at ensureProxies (file:///project/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]_@types+node_kksg7dl7df63ve4rt7ijxpt6ti/node_modules/@sveltejs/kit/src/core/sync/write_types/index.js:505:20)
    at process_node (file:///project/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]_@types+node_kksg7dl7df63ve4rt7ijxpt6ti/node_modules/@sveltejs/kit/src/core/sync/write_types/index.js:380:2)
    at update_types (file:///project/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]_@types+node_kksg7dl7df63ve4rt7ijxpt6ti/node_modules/@sveltejs/kit/src/core/sync/write_types/index.js:250:7)
    at write_types (file:///project/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]_@types+node_kksg7dl7df63ve4rt7ijxpt6ti/node_modules/@sveltejs/kit/src/core/sync/write_types/index.js:150:2)
    at Module.update (file:///project/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]_@types+node_kksg7dl7df63ve4rt7ijxpt6ti/node_modules/@sveltejs/kit/src/core/sync/sync.js:48:8)
    at file:///project/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]_@types+node_kksg7dl7df63ve4rt7ijxpt6ti/node_modules/@sveltejs/kit/src/exports/vite/dev/index.js:317:8
    at FSWatcher.<anonymous> (file:///project/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]_@types+node_kksg7dl7df63ve4rt7ijxpt6ti/node_modules/@sveltejs/kit/src/exports/vite/dev/index.js:291:5)
    at FSWatcher.emit (node:events:530:35) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: 'src/routes/app/someroute/[id]/+page.server.ts'
}

from vscode.

sheremet-va avatar sheremet-va commented on August 15, 2024 2

This should be fixed for everyone in 0.12.0.

from vscode.

jd1378 avatar jd1378 commented on August 15, 2024 1

thanks a lot for the quick fix
it seems to be working for me

from vscode.

jd1378 avatar jd1378 commented on August 15, 2024

Well It seems the error is happening in my source code somewhere when it's running app.use(serveStatic(app.get('public'))),
which seems to get some config, and that config is not loaded

and it seems the reason is that the working directory of the extension is not at the project, but somewhere in vscode folder in appdata

what can I do to set working directory to my project ?

from vscode.

hornta avatar hornta commented on August 15, 2024

I'm getting the same problem. This happens because you are rerunning the tests too quickly after changing the test file. You'll have to wait a bit, 5 seconds or so, after changing the file. I can reproduce this everytime if rerunning quickly after changing test files.

This might be a Windows only issue though.

from vscode.

jd1378 avatar jd1378 commented on August 15, 2024

This might be windows only, but the problem is not being too quickly, it outright crashes, because the working directory is set to somewhere other than the project

from vscode.

hornta avatar hornta commented on August 15, 2024

Yes I've also observed the cwd being incorrect which caused my test suite to fail. I could bypass that issue by finding the correct project folder by traversing backwards from __dirname but it's not elegant. For me, when I rerun the tests quickly after changing the test file, the test looks like they are running because a small loader appears in the top of the test explorer pane, but no test actually runs I think, because no console logs are recorded. I've never had vscode outright crash on me though.

from vscode.

sheremet-va avatar sheremet-va commented on August 15, 2024

I need some kind of reproduction that I can install and run to see the error by myself.

from vscode.

sheremet-va avatar sheremet-va commented on August 15, 2024

Then it just hangs. No way of resetting or restarting. The only way is to close vscode and reopen.

There is a "Refresh" button that should work:

Screenshot 2024-06-05 at 10 32 48

If it doesn't, I will need a reproduction to see why.

from vscode.

sheremet-va avatar sheremet-va commented on August 15, 2024

The potential fix is released in v0.11.0 - this is a pre-release version and you might need to enable it manually:

Screenshot 2024-06-05 at 10 48 25

Please let me know if it fixes your issue.

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.