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

🐛 extends using extenal packages not working with Yarn PnP #3391

Closed
1 task done
NedcloarBR opened this issue Jul 8, 2024 · 8 comments
Closed
1 task done

🐛 extends using extenal packages not working with Yarn PnP #3391

NedcloarBR opened this issue Jul 8, 2024 · 8 comments

Comments

@NedcloarBR
Copy link

NedcloarBR commented Jul 8, 2024

Environment information

CLI:
  Version:                      1.8.3
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           linux

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v20.6.1"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "yarn/4.3.1"

Biome Configuration:
  Status:                       Failed to load
  Error:                        Failed to resolve the configuration from /home/nedcloarbr/Projetos/nestjs-template

Workspace:
  Open Documents:               0

What happened?

I've created a package(@nedcloarbr/biome-config) that stores my biome settings.
At the moment I'm updating/creating project templates, but when setting up a template that uses Yarn PnP, the package configuration file is not found by the biome. If I configure yarn's nodeLinker to node-modules, the configuration is created, but in this template I need to use PnP to save space.

Playground

Expected result

It should find the config from external package when using Yarn PnP.

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@ematipico
Copy link
Member

This is a non-goal for now

@NedcloarBR
Copy link
Author

So I'll have to use nodeLinker: node-modules at the moment
Is there a roadmap containing this fix?

@ematipico
Copy link
Member

ematipico commented Jul 8, 2024

@NedcloarBR this is a non-goal, not a bug. We don't plan to support PNP for the time being.

Feel free to open a discussion if you want to propose it.

@NedcloarBR
Copy link
Author

Okay thanks!

@zach-betz-hln
Copy link

We're using Yarn PnP as well and ran into the same issue.

For what it's worth, we got it to work with a bit of config dancing. For example:

  1. Unplug the package

     yarn unplug @my-org/biome-config
    
  2. Find the file we want

     find .yarn/unplugged | grep 'biome-config/biome.json'
    
     # Example output: .yarn/unplugged/@my-org-biome-config-file-63207a0dac/node_modules/@my-org/biome-config/biome.json
    
  3. Create a biome.json. Replace {PATH_TO_BIOME} with the output of the above command

     {
       "extends": [
         "{PATH_TO_BIOME}"
       ]
     }
    

@NedcloarBR
Copy link
Author

Thank you for the answer
It worked perfectly here
I'm just having a problem with the VSCode extension that is not finding the Biome binary

Looks like a Yarn PnP workspace: /home/nedcloarbr/Projects/teste
Could not resolve Biome using Yarn PnP in /home/nedcloarbr/Projects/teste: Error: Required unplugged package missing from disk. This may happen when switching branches without running installs (unplugged packages must be fully materialized on disk to work).

Missing package: @biomejs/cli-linux-x64-musl@npm:1.9.4
Expected package location: /home/nedcloarbr/Projects/teste/.yarn/unplugged/@biomejs-cli-linux-x64-musl-npm-1.9.4-5f09c730ea/node_modules/@biomejs/cli-linux-x64-musl/

Could not resolve Biome in the dependencies of workspace folder: /home/nedcloarbr/Projects/teste
Searching for Biome in PATH
Biome binary found at /home/nedcloarbr/.vscode-server/data/User/globalStorage/biomejs.biome/server/biome
Executing Biome from: /home/nedcloarbr/.vscode-server/data/User/globalStorage/biomejs.biome/server/biome
[cli-stdout] data 49
[cli] exit 0
Connecting to "/home/nedcloarbr/.cache/biome/biome-socket-1.9.4" ...
[Info  - 6:26:16 PM] Server initialized with PID: 19490

I tried to install this dependency as unplugged and even so it didn't solve
But I think this should be mentioned in a new issue in the extension's repository

@NedcloarBR NedcloarBR reopened this Feb 17, 2025
@zach-betz-hln
Copy link

Glad to hear it on the extends working.

Yeah, agreed on creating a different issue for the vscode ext.

@ematipico
Copy link
Member

This isn't a bug. Biome doesn't support yarn pnp, that would be a feature. Feel free to open a discussion.

@ematipico ematipico closed this as not planned Won't fix, can't repro, duplicate, stale Feb 17, 2025
@biomejs biomejs locked and limited conversation to collaborators Feb 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants