sveltejs / vite-plugin-svelte

Svelte plugin for http://vitejs.dev/
MIT License
864 stars 105 forks source link

Inspector not opening editor, spawn code ENOENT #601

Closed probablykasper closed 1 year ago

probablykasper commented 1 year ago

Describe the bug

Whenever I use the inspector and click on something, it doesn't open the editor.

Reproduction URL

https://github.com/probablykasper/svelte-inspector-enoent-bug

Reproduction

  1. Create a SvelteKit app with the default options: npm create svelte@latest my-app
  2. Enable the inspector in svelte.config.js:
    vitePlugin: {
        experimental: {
            inspector: true,
        },
    },
  3. Use the Svelte inspector to click on an element to open it in the editor

Logs

Could not open +page.svelte in the editor.
The editor process exited with an error: spawn code ENOENT.

System Info

System:
    OS: macOS 10.15.7
    CPU: (8) x64 Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
    Memory: 235.95 MB / 32.00 GB
    Shell: 3.6.0 - /usr/local/bin/fish
  Binaries:
    Yarn: 3.3.0 - ~/Library/Application Support/Volta/tools/image/yarn/3.3.0/bin/yarn
    npm: 8.19.3 - ~/Library/Application Support/Volta/tools/image/node/18.13.0/bin/npm
  Browsers:
    Brave Browser: 110.1.48.171
    Chrome: 110.0.5481.177
    Edge: 110.0.1587.63
    Firefox: 109.0.1
    Firefox Developer Edition: 111.0
    Safari: 15.6.1
  npmPackages:
    @sveltejs/adapter-auto: ^2.0.0 => 2.0.0 
    @sveltejs/kit: ^1.5.0 => 1.11.0 
    svelte: ^3.54.0 => 3.55.1 
    vite: ^4.0.0 => 4.1.4
dominikg commented 1 year ago

reads like code isn't in your PATH. either add it or use LAUNCH_EDITOR=/path/to/vcsode/bin/code in env

probablykasper commented 1 year ago

Oh, you're totally right, my code binary had disappeared. Thank you!

samal-rasmussen commented 6 months ago

In vscode you can open the command palette and write install code to add code to path.