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.

pnpm support without `--shamefully-hoist`

See original GitHub issue

Update: Since v3.0 release, pnpm without shamefully-hoist flag works out of the box but there are still known issues to be addressed (in nuxt or upstream):

  • When pages enabled, vue-router dependency is implicit
  • Multiple instances of vue are can be resolved and used
  • Generated tyeps are not fully functional without hoisted node_modules

History: #581

We have progressively improved plug-and-play support over time and almost all underlying packages including nitro support and are tested against pnpm.

Last step is making nuxt 3 working with pnpm out of the box before migrating modules and templates from first-class yarn to pnpm.

Using pnpm without --shamefully-hoist is possible today 🥳 but requires explicitly installing vue and ufo dependencies and we don’t want this since Nuxt was always a zero-config package and we need to add deps of all nuxt modules as well this way.

One obvious solution is that same as Nitro, we internally (also for unimport ~> https://github.com/unjs/unimport/issues/69) resolve them to their full path but we also need to support non-resolved implicit imports in templates as modules might have similar implicit dependencies in their scope and they need to be resolved as well. I think this can be done using a custom resolver for vite (and webpack).

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:78
  • Comments:19 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
asonnleitnercommented, Jun 23, 2022

@jpsc Hi, made a PR in your repo, so you can check, also the fork is available on my profile here nuxt3-pnpm-monorepo

3reactions
bmulhollandcommented, Oct 24, 2022

Glad to see there’s movement on this. I didn’t get an answer to my question, though, and I don’t want it to be lost: when this issue is closed, will Yarn Berry PnP support work too? If not, is there a separate place that is being tracked? I couldn’t find one; they’ve all been closed in favour of this issue, which doesn’t mention yarn at all.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pnpm i should not require the --shamefully-hoist option #9834
When installing a front-end dependency with pnpm i, I do not want to have to provide the --shamefully-hoist option. Yet I still want...
Read more >
.npmrc | pnpm
Tells pnpm which packages should be hoisted to node_modules/.pnpm . By default, all packages are hoisted - however, if you know that only...
Read more >
@pnpm/hoist - npm
@pnpm/hoist. Hoists dependencies in a node_modules created by pnpm. Formerly @pnpm/shamefully-flatten . Installation.
Read more >
Is there a way to exclude a specific package from hoisting in ...
As of pnpm v6.7, pnpm does not allow to exclude from hoisting. With pnpm you define which package should be hoisted not which...
Read more >
pnpm/pnpm - Gitter
I can try --shamefully-hoist ... but this was working without that just an hour ago. Zoltan Kochan. @zkochan. is it a ...
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