-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
pnpm support without --shamefully-hoist
#14146
Comments
It would be nice if fixing this also fixes for |
I have a fully functional monorepo using pnpm workspaces, including cached docker build layers and deployment into k8s. Just by using --shamefully-hoist |
@asonnleitner I'm assuming that's not anywhere public? I've tried multiple times when on rc.1. I would love to check and compare it. |
@jpsc yeah, it's private, but if you could make a simple example monorepo, I could take a look at it over the next week and check what's causing the troubles |
@jpsc there are two ways i have found to use pnpm workspaces with nuxt3
|
I have an skeleton monorepo at https://gitlab.com/licensly/licensly/-/tree/shamefully-hoist. without and despite that to make it worse |
This option works if you go into each directory and do
This option seems counter-intuitive to force all packages to behave like that because of a limitation. @asonnleitner, if by any chance you have the time I've created a minimal reproducible repo here. Much appreciated! |
@jpsc Hi, made a PR in your repo, so you can check, also the fork is available on my profile here nuxt3-pnpm-monorepo |
Besides needing to install
To fix some error logs
|
I read through the associated issues, but couldn't understand the current status of yarn PnP support. Does the work enabling pnpm without hoisting also enable Yarn's PnP feature? Meaning Yarn Berry Plug 'n' Play isn't currently supported, but is being (indirectly) worked on. |
rc.11 still doesn't work without |
Nope, my bad. Still WIP |
I just created a sample project, just nuxi init, moved into a subproject and set srcDir. it got rc12. can't find vue. https://github.com/amery/nuxt3-5411
|
Yup, as I wrote, still work in progress - my bad |
yes, but I thought a proper test case was useful to add 😝 |
It definitely is 😋 |
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. |
Nuxt should now be working without If you are encountering any issues, please raise a new issue with a reproduction. Note that some modules may have their own issues and please do raise issues with them specifically (though feel free to point them to me if needed). (Finally, this may also mean you may need to install more dependencies explicitly in large projects.) |
That is awesome news :)
Den tis 17 okt. 2023 23:49Daniel Roe ***@***.***> skrev:
… Closed #14146 <#14146> as completed.
—
Reply to this email directly, view it on GitHub
<#14146 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEUQCTVSD5VBGNY5YMSJ6M3X734OJAVCNFSM6AAAAAAUATIVA6VHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJQGY4DIMRWGY4TEMY>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Is this the new recommended way? This should be in the docs then... |
I'm wondering if "shamefully-hoist=false" is recommended, but I can confirm that I was able to run it with "false" for now. (@nuxt/content gave me a dependency warning, but that's another issue.) |
huge news. Thanks a lot |
Amazing!! Big thanks! |
I opened nuxt-modules/i18n#2506 to track it for those of you who are interested. |
Modules such as [18:40:22] ERROR Failed to resolve import "tailwindcss/tailwind.css" from "virtual:nuxt:D:\xxx\.nuxt\css.mjs". Does the file exist?
[18:40:22] ERROR Failed to resolve import "element-plus" from "virtual:nuxt:D:\xxx\.nuxt\element-plus-injection.plugin.mjs". Does the file exist? and then lead to crush: ℹ Vite client warmed up in 22803ms 18:47:38
✔ Nitro built in 18164 ms nitro 18:47:46
[Vue Router warn]: No match found for location with path "/_nuxt/tailwindcss/tailwind.css"
[Vue Router warn]: No match found for location with path "/_nuxt/tailwindcss/tailwind.css"
[Vue Router warn]: No match found for location with path "/_nuxt/tailwindcss/tailwind.css"
[Vue Router warn]: No match found for location with path "/_nuxt/tailwindcss/tailwind.css"
[18:48:04] ERROR Failed to resolve import "tailwindcss/tailwind.css" from "virtual:nuxt:D:\xxx\apps\dalle-nuxt3\.nuxt\css.mjs". Does the file exist?
[18:48:04] ERROR Internal server error: Failed to resolve import "tailwindcss/tailwind.css" from "virtual:nuxt:D:\xxx\apps\dalle-nuxt3\.nuxt\css.mjs". Does the file exist?
Plugin: vite:import-analysis
File: virtual:nuxt:D:/xxx/apps/dalle-nuxt3/.nuxt/css.mjs:1:9
1 | import "tailwindcss/tailwind.css";
| ^
2 | import "@/assets/css/global.css";
at formatError (file:///D:/xxx/node_modules/.pnpm/vite@4.5.0_@types+node@20.5.1_sass@1.69.4/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:44062:46)
at TransformContext.error (file:///D:/xxx/node_modules/.pnpm/vite@4.5.0_@types+node@20.5.1_sass@1.69.4/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:44058:19)
at normalizeUrl (file:///D:/xxx/node_modules/.pnpm/vite@4.5.0_@types+node@20.5.1_sass@1.69.4/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:41844:33)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async file:///D:/xxx/node_modules/.pnpm/vite@4.5.0_@types+node@20.5.1_sass@1.69.4/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:41998:47
at async Promise.all (index 0)
at async TransformContext.transform (file:///D:/xxx/node_modules/.pnpm/vite@4.5.0_@types+node@20.5.1_sass@1.69.4/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:41914:13)
at async file:///D:/xxx/node_modules/.pnpm/vite-plugin-inspect@0.7.40_@nuxt+kit@3.8.0_vite@4.5.0/node_modules/vite-plugin-inspect/dist/index.mjs:922:19
at async Object.transform (file:///D:/xxx/node_modules/.pnpm/vite@4.5.0_@types+node@20.5.1_sass@1.69.4/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:44352:30)
at async loadAndTransform (file:///D:/xxx/node_modules/.pnpm/vite@4.5.0_@types+node@20.5.1_sass@1.69.4/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:55026:29)
[Vue Router warn]: No match found for location with path "/_nuxt/@id/virtual:nuxt:D:/xxx/apps/dalle-nuxt3/.nuxt/css.mjs"
[Vue Router warn]: No match found for location with path "/_nuxt/@id/virtual:nuxt:D:/xxx/apps/dalle-nuxt3/.nuxt/css.mjs"
[Vue Router warn]: No match found for location with path "/_nuxt/@id/virtual:nuxt:D:/xxx/apps/dalle-nuxt3/.nuxt/css.mjs"
[Vue Router warn]: No match found for location with path "/_nuxt/@id/virtual:nuxt:D:/xxx/apps/dalle-nuxt3/.nuxt/css.mjs"
[18:48:04] ERROR Internal server error: Failed to resolve import "element-plus" from "virtual:nuxt:D:\xxx\apps\dalle-nuxt3\.nuxt\element-plus-injection.plugin.mjs". Does the file exist?
Plugin: vite:import-analysis
File: virtual:nuxt:D:/xxx/apps/dalle-nuxt3/.nuxt/element-plus-injection.plugin.mjs:2:35
1 | import { defineNuxtPlugin } from '#app';
2 | import { ID_INJECTION_KEY } from 'element-plus';
| ^
3 |
4 | export default /* #__PURE__ */ defineNuxtPlugin(nuxtApp => {
at formatError (file:///D:/xxx/node_modules/.pnpm/vite@4.5.0_@types+node@20.5.1_sass@1.69.4/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:44062:46)
at TransformContext.error (file:///D:/xxx/node_modules/.pnpm/vite@4.5.0_@types+node@20.5.1_sass@1.69.4/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:44058:19)
at normalizeUrl (file:///D:/xxx/node_modules/.pnpm/vite@4.5.0_@types+node@20.5.1_sass@1.69.4/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:41844:33)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async file:///D:/xxx/node_modules/.pnpm/vite@4.5.0_@types+node@20.5.1_sass@1.69.4/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:41998:47
at async Promise.all (index 1)
at async TransformContext.transform (file:///D:/xxx/node_modules/.pnpm/vite@4.5.0_@types+node@20.5.1_sass@1.69.4/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:41914:13)
at async file:///D:/xxx/node_modules/.pnpm/vite-plugin-inspect@0.7.40_@nuxt+kit@3.8.0_vite@4.5.0/node_modules/vite-plugin-inspect/dist/index.mjs:922:19
at async Object.transform (file:///D:/xxx/node_modules/.pnpm/vite@4.5.0_@types+node@20.5.1_sass@1.69.4/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:44352:30)
at async loadAndTransform (file:///D:/xxx/node_modules/.pnpm/vite@4.5.0_@types+node@20.5.1_sass@1.69.4/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:55026:29)
[Vue Router warn]: No match found for location with path "/_nuxt/@id/virtual:nuxt:D:/xxx/apps/dalle-nuxt3/.nuxt/element-plus-injection.plugin.mjs"
[Vue Router warn]: No match found for location with path "/_nuxt/@id/virtual:nuxt:D:/xxx/apps/dalle-nuxt3/.nuxt/element-plus-injection.plugin.mjs"
[Vue Router warn]: No match found for location with path "/_nuxt/@id/virtual:nuxt:D:/xxx/apps/dalle-nuxt3/.nuxt/element-plus-injection.plugin.mjs"
[Vue Router warn]: No match found for location with path "/_nuxt/@id/virtual:nuxt:D:/xxx/apps/dalle-nuxt3/.nuxt/element-plus-injection.plugin.mjs" Is there any solution for that? |
@gyhyfj This was mentioned in Daniel's comment above #14146 (comment)
|
@nuxt/content issue for pnpm compatibility: |
…580) This is no longer needed, see nuxt/nuxt#14146.
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):vue-router
dependency is implicitnode_modules
History: #11823
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 installingvue
andufo
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
~> unjs/unimport#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).The text was updated successfully, but these errors were encountered: