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

Plugins not found when using pnpm. #3417

Closed
theo0165 opened this issue Jul 11, 2022 · 4 comments
Closed

Plugins not found when using pnpm. #3417

theo0165 opened this issue Jul 11, 2022 · 4 comments

Comments

@theo0165
Copy link

theo0165 commented Jul 11, 2022

Describe the bug

When installing dependencies with pnpm sanity can't run because it cant find plugins. Sanity is looking for plugins in the node_modules folder but not in the .pnpm folder that pnpm creates.

When starting the studio with sanity start, the following error is thrown.

Error: Plugin "@sanity/data-aspects" not found.
Locations tried:
  * /Users/.../src/web/studio/plugins/@sanity/data-aspects
  * /Users/.../src/web/studio/node_modules/@sanity/desk-tool/node_modules/@sanity/data-aspects
  * /Users/.../src/web/studio/node_modules/@sanity/data-aspects
  * /Users/.../src/web/node_modules/@sanity/data-aspects
  * /Users/.../src/node_modules/@sanity/data-aspects
  * /Users/.../node_modules/@sanity/data-aspects
  * /Users/.../node_modules/@sanity/data-aspects
  * /Users/.../node_modules/@sanity/data-aspects
  * /Users/.../node_modules/@sanity/data-aspects
  * /Users/node_modules/@sanity/data-aspects
  * /node_modules/@sanity/data-aspects
Try running "sanity install @sanity/data-aspects"?
    at getPluginNotFoundError (~/.../src/web/studio/node_modules/.pnpm/@sanity+resolver@2.29.5/node_modules/@sanity/resolver/lib/resolvePlugins.js:133:13)
    at ~/.../src/web/studio/node_modules/.pnpm/@sanity+resolver@2.29.5/node_modules/@sanity/resolver/lib/resolvePlugins.js:125:13
    at async Promise.all (index 1)
    at async Promise.all (index 3)
    at async Promise.all (index 3)

(Some paths modified for privacy reasons)

To Reproduce

Steps to reproduce the behavior:

  1. Create a Sanity project.
  2. Install dependencies with pnpm.
  3. Try to start the studio with sanity start.

Expected behavior

The studio should start like normal and look for plugins in the node_modules/.pnpm folder.

Which versions of Sanity are you using?

@sanity/cli                   2.30.2 (latest: 3.0.0-dev-preview.11)
@sanity/base                  2.30.1 (up to date)
@sanity/cli                   2.30.2 (latest: 3.0.0-dev-preview.11)
@sanity/core                  2.30.2 (up to date)
@sanity/default-layout        2.30.1 (up to date)
@sanity/default-login         2.30.1 (up to date)
@sanity/desk-tool             2.30.1 (up to date)
@sanity/eslint-config-studio   2.0.0 (up to date)
@sanity/vision                2.30.1 (latest: 3.0.0-dev-preview.11)

What operating system are you using?

macOS Monterey 12.4

Which versions of Node.js / npm are you running?

npm: 8.5.0
node: v16.14.2
pnpm: 7.5.0

Additional context

When I tried to install @sanity/data-aspects with sanity install @sanity/data-aspects i got the same error with a new plugin. The need to install every plugin like that defeats the purpose of pnpm.

@theo0165
Copy link
Author

No update on this issue?

@tomi
Copy link

tomi commented Sep 15, 2022

I managed to get this working by configuring the node-linker configuration option to hoisted in the .npmrc file:

node-linker = hoisted

@theo0165
Copy link
Author

@tomi But that kind of defeats the purpose of pnpm, a native solution would be better.

@rexxars
Copy link
Member

rexxars commented Dec 12, 2022

Note that Sanity Studio v3 is now released and should fully support pnpm!

@rexxars rexxars closed this as completed Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants