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

[bug] fail to open assets in editor on macOS #185

Closed
LoTwT opened this issue Jan 19, 2024 · 10 comments
Closed

[bug] fail to open assets in editor on macOS #185

LoTwT opened this issue Jan 19, 2024 · 10 comments
Labels
documentation Improvements or additions to documentation

Comments

@LoTwT
Copy link
Contributor

LoTwT commented Jan 19, 2024

description

fail to open assets in editor on macOS

devtools-next-assets-openInEditor.mp4

version

"vite-plugin-vue-devtools": "^7.0.11",

env info

  • System:
    • OS: macOS 14.3
    • CPU: (10) arm64 Apple M1 Pro
    • Memory: 3.53 GB / 32.00 GB
    • Shell: 5.9 - /bin/zsh
  • Binaries:
    • Node: 20.11.0 - ~/Library/Caches/fnm_multishells/64820_1705656024800/bin/node
    • npm: 10.2.4 - ~/Library/Caches/fnm_multishells/64820_1705656024800/bin/npm
    • pnpm: 8.14.1 - ~/Library/pnpm/pnpm
  • Browsers:
    • Chrome: 120.0.6099.234
  • npmPackages:
    • vue: ^3.4.15 => 3.4.15

additional context

It works in the stackblitz.

URL: https://stackblitz.com/edit/vitejs-vite-b2m26r?file=vite.config.ts

@alexzhang1030
Copy link
Member

/cc @webfansplz Does package.json should be here?

@webfansplz
Copy link
Member

/cc @webfansplz Does package.json should be here?

Yeah, I think it makes sense to show it.

@titibudala
Copy link

Same configuration (mostly) and same issue as @LoTwT

Alt Text

@alexzhang1030
Copy link
Member

@LoTwT Can you show your real file path and the incorrect file path of the assets page? You can hover the file path row to get the details.

@alexzhang1030 alexzhang1030 added bug Something isn't working client scope: devtools client labels Jan 23, 2024
@LoTwT
Copy link
Contributor Author

LoTwT commented Jan 23, 2024

@LoTwT Can you show your real file path and the incorrect file path of the assets page? You can hover the file path row to get the details.

The filepath on the assets page:

image

The filepath copied in VSCode: /Users/caoyujie/codes/vite-assets/package.json.

They are the same indeed.

@alexzhang1030
Copy link
Member

Unfortunately, I can't reproduce this issue, so we need your help to test it. The capabilities of our openInEditor feature are supported by Vite built-in.

Can you test this Vite feature? That will help us to find out if this is an upstream issue. Thank you.

@LoTwT
Copy link
Contributor Author

LoTwT commented Jan 23, 2024

Unfortunately, I can't reproduce this issue, so we need your help to test it. The capabilities of our openInEditor feature are supported by Vite built-in.

Can you test this Vite feature? That will help us to find out if this is an upstream issue. Thank you.

Thanks.

I tried the URL http://localhost:5173/__open-in-editor?file=package.json manually. It comes into the same error. I will try to find the problem myself locally.

@LoTwT
Copy link
Contributor Author

LoTwT commented Jan 23, 2024

After looking around the codebase of launch-editor-middleware, I find that the command to open VSCode on macOS is code. It means that developers must install the command code in PATH. Unfortunately, I didn't set it well.

How to set:

  • open a VSCode
  • use Shift + Command + P open All Commands panel
  • input Shell Command: Install 'code' command in PATH and select
  • install successfully

After setting it, I successfully open the target file in the VSCode.

Hi, @titibudala . Could you try the above solution? 😊

@webfansplz
Copy link
Member

I'll mention it in the document, also be related to #125

@webfansplz webfansplz added documentation Improvements or additions to documentation and removed bug Something isn't working client scope: devtools client labels Jan 23, 2024
@titibudala
Copy link

Yesss! That was it @LoTwT, thank you! 🫡

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

No branches or pull requests

4 participants