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

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

Open
tusharmath opened this issue Feb 7, 2019 · 7 comments
Open

Comments

@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
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
Copy link
Author

@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
Copy link
Member

arcanis commented Feb 8, 2019

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

@arcanis
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
Copy link
Author

@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
@SEAPUNK
Copy link

SEAPUNK commented May 14, 2019

Getting the same (or similar) error. We're trying to use an external dependency that doesn't specify "react" as a peer dependency (but tries to import it), but it fails even if our top level package has "react" in its dependency list.

workspace/
	projecta/ {react, pkg}
		[pkg doesn't have react in peerDeps, but tries to import it]

@artemis-prime
Copy link

Still seeing this! And I'm trying to use install-peers-cli which is not found!

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

4 participants