Skip to content

Cannot build when using yarn 2 #928

Open
@ghost

Description

Describe the bug
When I'm trying to build my app with webpack after adding yarn as a package manager
yarn serve
I get the following errors in the console

ERROR in ./.yarn/$$virtual/apollo-utilities-virtual-7a551de862/0/cache/apollo-utilities-npm-1.3.3-8e73ac22c0-2.zip/node_modules/apollo-utilities/lib/bundle.esm.js
Module not found: Error: A package is trying to access a peer dependency that should be provided by its direct ancestor but isn't

Required package: graphql (via "graphql/language/visitor")
Required by: apollo-utilities@virtual:43f461c7bc5ff415623b481e4ad83d91ad0bd26c6fbb664d4f13c6d20ed73069f015be0b5c0f6e7fe5bf339862792c547b83608648c40b27cfb110b6528915ef#npm:1.3.3 (via ./.yarn/$$virtual/apollo-utilities-virtual-7a551de862/0/cache/apollo-utilities-npm-1.3.3-8e73ac22c0-2.zip/node_modules/apollo-utilities/lib/bundle.esm.js)

As soon as I reinstall the modules with npm install && npm run serve everything works as expected.

To Reproduce
Steps to reproduce the behavior:

  1. Install yarn to any project with vue-apollo client yarn add -D yarn
  2. Run ./node_modules/.bin/yarn set version berry
  3. Run yarn
  4. Add webpack pnp-plugin
  5. Run project build script with yarn
  6. Get the error

Expected behavior
It should be buildable with yarn 2.

Versions
vue: 2.6.11
vue-apollo: 3.0.3
apollo-boost: ^0.4.7

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions