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

Peer dependencies not getting installed in PNP mode with workspaces #7014

Open
tusharmath opened this Issue Feb 7, 2019 · 5 comments

Comments

Projects
None yet
2 participants
@tusharmath
Copy link

tusharmath commented Feb 7, 2019

Do you want to request a feature or report a bug?
bug

What is the current behavior?
Peer dependencies don't get installed in workspaces.
Refer: https://github.com/tusharmath/pnp-peer-dep-repro

If the current behavior is a bug, please provide the steps to reproduce.

  1. Create a yarn workspace.
  2. Create a module M inside the workspace, that depends on D.
  3. Say D has a peerDependency on P.
  4. So I add P as a dependency to my my module M
  5. Performing yarn --pnp Doesn't install P

What is the expected behavior?

  • Performing yarn --pnp should install P

Please mention your node.js, yarn and operating system version.
node : 10.7.0
OS: Mac OS 10.13.6

@arcanis

This comment has been minimized.

Copy link
Member

arcanis commented Feb 8, 2019

Performing yarn --pnp should install P

It shouldn't, hence why it doesn't 😛

Add P as a devDependencies entry to install it locally.

@tusharmath

This comment has been minimized.

Copy link
Author

tusharmath commented Feb 8, 2019

@arcanis Silly me, I updated the question. I have added P as a dependency to my module M but still it doesn't install P.

Error:

/Users/tushar/Documents/Projects/mobile-web-dream11/.pnp.js:16111
    throw firstError;
    ^

Error: Package "@gql2ts/util@pnp:6dfb38b5679e03e41b634dc79240a5b1c972bf64" (via "/Users/tushar/Documents/Projects/mobile-web-dream11/.pnp/externals/pnp-6dfb38b5679e03e41b634dc79240a5b1c972bf64/node_modules/@gql2ts/util/dist/schema.js") is trying to require the package "graphql" (via "graphql") without it being listed in its dependencies (@gql2ts/util)
    at makeError (/Users/tushar/Documents/Projects/mobile-web-dream11/.pnp.js:55:17)
    at Object.resolveToUnqualified (/Users/tushar/Documents/Projects/mobile-web-dream11/.pnp.js:15849:17)
    at Object.resolveRequest (/Users/tushar/Documents/Projects/mobile-web-dream11/.pnp.js:15920:31)
    at Function.Module._resolveFilename (/Users/tushar/Documents/Projects/mobile-web-dream11/.pnp.js:16102:30)
    at Function.Module._load (/Users/tushar/Documents/Projects/mobile-web-dream11/.pnp.js:16018:31)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/Users/tushar/Documents/Projects/mobile-web-dream11/.pnp/externals/pnp-6dfb38b5679e03e41b634dc79240a5b1c972bf64/node_modules/@gql2ts/util/dist/schema.js:3:19)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
@arcanis

This comment has been minimized.

Copy link
Member

arcanis commented Feb 8, 2019

Hm that's weird - would you have a repro repo, by any chance?

@arcanis

This comment has been minimized.

Copy link
Member

arcanis commented Feb 8, 2019

Or if you can open a PR to add a failing test to packages/pkg-tests/pkg-tests-specs/pnp.js it would be even better

@tusharmath

This comment has been minimized.

Copy link
Author

tusharmath commented Feb 9, 2019

@arcanis Its specific to yarn workspaces I think. Here is the repro —

https://github.com/tusharmath/pnp-peer-dep-repro

@tusharmath tusharmath changed the title Peer dependencies not getting installed in PNP mode Peer dependencies not getting installed in PNP mode with workspaces enabled Feb 9, 2019

@tusharmath tusharmath changed the title Peer dependencies not getting installed in PNP mode with workspaces enabled Peer dependencies not getting installed in PNP mode with workspaces Feb 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment