question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support Yarn 2, especially regarding stricter peerDependencies constraints

See original GitHub issue

Describe the bug Quasar does not specify Vue as peer dependency but imports from it. I’m using yarn@2 and it much stricter and is not allowing package to use other packages without specifying them as dependencies.

Codepen/jsFiddle/Codesandbox (required) https://github.com/Demivan/quasar-yarn-2-issue

To Reproduce Steps to reproduce the behavior:

  1. Checkout repository
  2. run yarn build
  3. See build error.

Expected behavior No build error should be produced.

Screenshots With webpack

ERROR in ./.yarn/cache/quasar-npm-1.12.13-43fa104864-2.zip/node_modules/quasar/src/utils/open-url.js 1:0-21
Module not found: Error: A package is trying to access another package without the second one being listed as a dependency of the first one

Required package: vue (via "vue/dist/vue.runtime.esm.js")
Required by: quasar@npm:1.12.13 (via ./.yarn/cache/quasar-npm-1.12.13-43fa104864-2.zip/node_modules/quasar/src/utils/)

With rollup:

(node:139528) [MODULE_NOT_FOUND] Error: quasar tried to access vue, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
(Use `node --trace-warnings ...` to show where the warning was created)

Platform (please complete the following information): Yarn: yarn@2 berry

Additional context Fix using .yarnrc.yml: https://github.com/Demivan/quasar-yarn-2-issue/blob/fix/.yarnrc.yml

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:22 (13 by maintainers)

github_iconTop GitHub Comments

5reactions
yusufkandemircommented, Jun 5, 2022

@maggie0002 @taai the error regarding resolving Vite’s version (TypeError: Cannot read property 'version' of undefined) will be addressed in #13609.

2reactions
rstoenescucommented, Oct 23, 2021

Please use Yarn v1 for the moment. The v2 of Yarn has some hard requirements that forces us to not be able to provide a good developer experience.

We have plans to create a CLI based on Vite instead of Webpack and that will allow us to officially support Yarn 2.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Plug'n'Play | Yarn - Package Manager
An overview of Plug'n'Play, a powerful and innovative installation strategy for Node.
Read more >
Introducing Yarn 2 ! - DEV Community ‍ ‍
Even better, portals properly follow peer dependencies, regardless of the location of the symlinked package. Workspace Releases. Working with ...
Read more >
Should You Use Upper Bound Version Constraints?
To be clear, Poetry doesn't force version pinning on you, ... Really large libraries hate making major releases - Python 2->3 was a...
Read more >
[AskJS] Is someone using Yarn v2 in business? - Reddit
For help, questions, and anything Yarn related, there is an official ... of Yarn 2 (new commands, new protocols, plugins, constraints, etc.) ...
Read more >
Why use peer dependencies?
Why use a peer dependency? ... I've been an advocate for using peer dependencies in consuming libraries because it provides a few key...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found