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: cannot find Astro installation with yarn berry #659

Open
lucas-labs opened this issue Sep 28, 2023 · 3 comments
Open

🐛 BUG: cannot find Astro installation with yarn berry #659

lucas-labs opened this issue Sep 28, 2023 · 3 comments
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) feat: yarn-pnp Issue specific to yarn pnp support (scope)

Comments

@lucas-labs
Copy link

Describe the Bug

Intellisense doesn't seem to get along with yarn berry.

I've installed the sdk, and configured the ls-path option accordingly

sdk

// user settings

{
    // also tried relative paths, \\, etc, just in case; but still doesn't work
    "astro.language-server.ls-path": "D:/dev/astro/.yarn/sdks/@astrojs/language-server/bin/nodeServer.js"
}

This is how it looks:

bug

As you can see in the image above, the Astro variable is being recognized as a global variable, but it is coming as if it were of type any, and since its type is any, intellisense dies right there:

no-intellisense

There's not errors or warnings in the output logs.

I'm testing this on win11, I'll try it on macos and ubuntu next week when I get back from vacation

Steps to Reproduce

  1. yarn create astro
  2. yarn add @astrojs/language-server - this is to let yarn know it has to install the astro sdk
  3. yarn dlx @yarnpkg/sdks vscode - yarn will detect astro and install the sdk
  4. set vscode user setting astro.language-server.ls-path to path/to/repo/astro/.yarn/sdks/@astrojs/language-server/bin/nodeServer.js
  5. No intellisense :(
@Princesseuh
Copy link
Member

That's not intellisense not working, that's it not finding the Astro installation. I don't think this is yarn berry specific, it tries to find it from the root of your workspace (through a simple require.resolve)

@imballinst
Copy link

I think this is similar with #655, I also experience Intellisense not working. But only when I'm using nodeLinker: pnp though. When I have nodeLinker: pnpm, it's working normally. Might be something-something with the existence of node_modules folder.

@Princesseuh Princesseuh added bug feat: yarn-pnp Issue specific to yarn pnp support (scope) labels Oct 2, 2023
@Princesseuh Princesseuh changed the title 🐛 BUG: intellisense not working with yarn berry 🐛 BUG: cannot find Astro installation with yarn berry Nov 4, 2023
@Princesseuh Princesseuh added - P3: minor bug An edge case that only affects very specific usage (priority) and removed bug labels Nov 12, 2023
@mikemykhaylov
Copy link

mikemykhaylov commented Dec 6, 2023

Hmm, I get a different error when running steps 1-3:

[Error - 3:32:51 PM] Server initialization failed.
  Message: Request initialize failed with message: ENOTDIR: not a directory, stat '/Users/homedir/.yarn/berry/cache/@volar-language-server-npm-1.10.10-3fb40bf23d-10c0.zip/node_modules/@volar/language-server/out/common/features/customFeatures.js'
  Code: -32603 
[Error - 3:32:51 PM] Astro Language Server client: couldn't create connection to server.
  Message: Request initialize failed with message: ENOTDIR: not a directory, stat '/Users/homedir/.yarn/berry/cache/@volar-language-server-npm-1.10.10-3fb40bf23d-10c0.zip/node_modules/@volar/language-server/out/common/features/customFeatures.js'
  Code: -32603 

Looks like it does find it, but not sure why it complains about a volar language server. Installing @volar/language-server and rerunning yarn dlx @yarnpkg/sdks vscode doesn't fix it either

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) feat: yarn-pnp Issue specific to yarn pnp support (scope)
Projects
None yet
Development

No branches or pull requests

4 participants