microsoft / vscode-livepreview

Hosts a local server in your workspace for you to preview your webpages.
http://aka.ms/live-preview
MIT License
381 stars 54 forks source link

External browser can't be found after renaming browser executable #535

Open mjbvz opened 12 months ago

mjbvz commented 12 months ago

Type: Bug

From #421

  1. With a new user data dir
  2. Set "livePreview.customExternalBrowser": "Firefox"
  3. Rename Firefox.app in /Applications to aFirefox.app
  4. Run Show Preview (external browser)
  5. Firefox launches
  6. Now rename aFirefox.app back to Firefox.app
  7. Try running Show Preview (external browser) again

bug I keep seeing the error:

Error running browser: spawn /Applications/aFirefox.app/Contents/MacOS/firefox ENOENT

I can't seem to get out of this state

Extension version: 0.5.2023072001 VS Code version: Code - Insiders 1.81.0-insider (Universal) (862fa13002d8018c328931ee1edccfd4ca76447d, 2023-07-26T05:36:43.574Z) OS version: Darwin x64 22.6.0 Modes:

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz (16 x 2400)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|2, 3, 4| |Memory (System)|32.00GB (0.02GB free)| |Process Argv|--crash-reporter-id 48781ca2-1705-4f64-9bab-325055aab55d| |Screen Reader|no| |VM|0%|
andreamah commented 11 months ago

This is probably because the debug companion caches the browser location. https://github.com/microsoft/vscode-js-debug-companion/blob/dbb6cd6d1063e7350191285f95d93ead1bb03635/src/spawn.ts#L50-L52

I'll have to check later whether this repros in js-debug with chome or edge.