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

Support Plug-n-Play (yarn v2) #1263

Closed
brandon-leapyear opened this issue Dec 1, 2020 · 2 comments
Closed

Support Plug-n-Play (yarn v2) #1263

brandon-leapyear opened this issue Dec 1, 2020 · 2 comments

Comments

@brandon-leapyear
Copy link

brandon-leapyear commented Dec 1, 2020

I'm submitting a...


[ ] Regression 
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

Running tests with yarn version 2 shows a bunch of errors like

The "apollo-server-express" package is missing. Please, make sure to install this library ($ npm install apollo-server-express) to take advantage of GraphQLModule.

Yarn version 2 started using the Plug-n-Play API, which prevents packages from require-ing dependencies not explicitly listed in the package's package.json. I'm not sure what the best solution is, but one solution is to add apollo-server-express as a peer dependency for @nestjs/graphql. This workaround works for me

# .yarnrc.yml
packageExtensions:
  '@nestjs/graphql@*':
    peerDependencies:
      'apollo-server-express': '*'
      '@apollo/federation': '*'

Also see: nestjs/nest#5836

Expected behavior

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Environment


Nest version: X.Y.Z

 
For Tooling issues:
- Node version: XX  
- Platform:  

Others:

@PiDelport
Copy link

@nestjs/graphql is also missing peer dependencies for class-transformer and class-validator (requested by @nestjs/mapped-types)

➤ YN0002: │ @nestjs/graphql@npm:7.9.8 [59d7f] doesn't provide class-transformer (pbe5e2), requested by @nestjs/mapped-types
➤ YN0002: │ @nestjs/graphql@npm:7.9.8 [59d7f] doesn't provide class-validator (p7ca35), requested by @nestjs/mapped-types

Workaround:

packageExtensions:
  '@nestjs/graphql@*':
    peerDependencies:
      class-transformer: '^0.3.2'
      class-validator: '^0.13.1'

PiDelport added a commit to registreerocks/registree-core that referenced this issue Feb 9, 2021
PiDelport added a commit to registreerocks/registree-core that referenced this issue Feb 9, 2021
@kamilmysliwiec
Copy link
Member

Let's track this here #1439

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