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.

Yarn Plug'n'Play Support

See original GitHub issue

Is your feature request related to a problem? Please describe. I’m using the latest yarn (v2.4.0), currently with the node-modules linker but would like to switch to the more modern UP’n’P, which has become the default for Yarn 2.

When removing the nodeLinker: node-modules option, the getQuasarAppExecutable function fails to resolve @quasar/app since the environment is missing UP’n’P capabilities. This can, however, be fixed by adding an environment variable NODE_OPTIONS="--require <path-to-.pnp.js>" linking to the .pnp.js of the project folder. This can be done using --require .\.pnp.js and works just fine, instead of Quasar CLI help displaying, Quasar App is started and dev server is launched. However, down the line, getPackageJson seems to return undefined, likely because require('../../package.json') cannot be resolved.

Describe the solution you’d like Yarn 2/P’n’P should work out of the box with Quasar, without needing to set environment variables manually or throwing errors. It took me a bit until I figured out that nodeLinker: node-modules was required for Quasar to work, making the experience of using the latest yarn (always recommended) have a few hiccups.

Describe alternatives you’ve considered I’m currently working on investigating all issues with Yarn 2 P’n’P and trying to resolve them, however, at work there is only so much time I can spend working on outside projects. I will look into this more in my free time, but I need to get comfortable with Quasars App code first, understanding the CLI package was easy due to its small size. As such, any help, additional issue reports and hints are appreciated!

Additional context image quasar d working (instead of displaying cli help page after @quasar/app couldn’t be resolved) after setting environment variable, but quickly failing due to path resolving issues.

Some Notes Webpack v4 has no native support for UPnP, however there is pnp-webpack-plugin which adds support. If PnP is supported natively by quasar, this should be installed in quasars webpack config. Webpack 5 ships with native support for UPnP. While that makes it easier for any version shipping with Webpack 5 (Quasar 2 hopefully 😉), even if Quasar 1 won’t get Webpack 5 support, I’d still like this feature to be in App v2, since it makes using Quasar with yarn easy out of the box and is also the version we will stay on for a little while at our company, and likely will others until Vue 3 has matured. This also means I’ll be working on fixing issues with the current App version instead of working in vue3-work.

For me at least, that will make my efforts worthwhile, and I hope I’m able to resolve all issues surrounding yarn v2 (with any help greatly appreciated as my resources are limited.)

Edit: Hitting Ctrl+Enter accidentally sends the issue, oops. Finished my description now. Edit 2: Yes, I know I’m not on latest quasar yet, just got back to work this morning and am still updating all deps, however I wanted to get this issue opened asap to see if anybody already has done some work on Yarn v2 P’n’P. Now tested: As expected it does not work on latest quasar.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

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. ... Native support; Support via plugins; Incompatible.
Read more >
yarn - Getting started with Plug n Play - w3resource
In this tutorial we gave you an overview of what Plug'n'Play is, as well as why you will need it.
Read more >
yarn 2 / Plug N Play Support · Issue #2386 · nrwl/nx - GitHub
Yarn has finally released a usable version two. If you using webpack 4 you need to enable PlugNPlay which is native to webpack...
Read more >
get rid of node_modules with Yarn Plug'n'Play - Medium
A special resolver is used in order to help Node discovering where each dependency has been installed (under the Yarn cache folder).
Read more >
Compatibililty with Yarn PnP (Plug and Play) feature - YouTrack
This seems quite challenging for IntelliJ, hope to see some support anyway. Attachments 8. pdfPlugnplay (1). image1573950205377.png. image1574174534715.png.
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