Skip to content
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

Completely broken installation with pnpm #970

Open
brawaru opened this issue Aug 27, 2023 · 3 comments
Open

Completely broken installation with pnpm #970

brawaru opened this issue Aug 27, 2023 · 3 comments

Comments

@brawaru
Copy link

brawaru commented Aug 27, 2023

Describe the bug

When installing with pnpm, the installation is completely broken and refuses to launch.

Steps to reproduce

  1. Run pnpm dlx nuxi init docs -t themes/docus (npx produces the same result)
  2. Run cd docs; pnpm dev

Expected behaviour

Dev server starts up and you see Docus app in its default configuration.

Actual behaviour

Dev server starts up, but immediately throws a bunch of errors and crashes with error.

Accessing / returns:

{
  "statusCode": 404,
  "statusMessage": "Cannot find any path matching /.",
  "stack": []
}
Console output
➜  /workspace pnpm dev

> docus-starter@0.1.0 dev /workspace
> nuxi dev

Nuxt 3.7.0 with Nitro 2.6.1                                                                       2:01:20 PM
                                                                                                  2:01:21 PM
  ➜ Local:    http://localhost:3000/
  ➜ Network:  use --host to expose

✔ Nuxt Devtools is enabled v0.6.7 (experimental)                                                 2:01:23 PM

 WARN  [nuxt] Two component files resolving to the same name Ellipsis:                            2:01:25 PM

 - /workspace/node_modules/.pnpm/@nuxt-themes+elements@0.9.4_postcss@8.4.28_rollup@3.28.1_vue@3.3.4/node_modules/@nuxt-themes/elements/components/globals/Ellipsis.vue
 - /workspace/node_modules/.pnpm/@nuxt-themes+docus@1.14.6_nuxt@3.7.0_postcss@8.4.28_rollup@3.28.1_vue@3.3.4/node_modules/@nuxt-themes/docus/components/app/Ellipsis.vue


 WARN  [nuxt] Two component files resolving to the same name SourceLink:                          2:01:25 PM

 - /workspace/node_modules/.pnpm/@nuxt-themes+elements@0.9.4_postcss@8.4.28_rollup@3.28.1_vue@3.3.4/node_modules/@nuxt-themes/elements/components/globals/SourceLink.vue
 - /workspace/node_modules/.pnpm/@nuxt-themes+docus@1.14.6_nuxt@3.7.0_postcss@8.4.28_rollup@3.28.1_vue@3.3.4/node_modules/@nuxt-themes/docus/components/docs/SourceLink.vue


 WARN  [nuxt] Two component files resolving to the same name DocumentDrivenNotFound:              2:01:25 PM

 - /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/components/DocumentDrivenNotFound.vue
 - /workspace/node_modules/.pnpm/@nuxt-themes+docus@1.14.6_nuxt@3.7.0_postcss@8.4.28_rollup@3.28.1_vue@3.3.4/node_modules/@nuxt-themes/docus/components/app/DocumentDrivenNotFound.vue


 WARN  [nuxt] Two component files resolving to the same name ProseA:                              2:01:25 PM

 - /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/components/Prose/ProseA.vue
 - /workspace/node_modules/.pnpm/@nuxt-themes+typography@0.11.0_postcss@8.4.28_rollup@3.28.1_vue@3.3.4/node_modules/@nuxt-themes/typography/components/global/ProseA.vue


 WARN  [nuxt] Two component files resolving to the same name ProseBlockquote:                     2:01:25 PM

 - /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/components/Prose/ProseBlockquote.vue
 - /workspace/node_modules/.pnpm/@nuxt-themes+typography@0.11.0_postcss@8.4.28_rollup@3.28.1_vue@3.3.4/node_modules/@nuxt-themes/typography/components/global/ProseBlockquote.vue


 WARN  [nuxt] Two component files resolving to the same name ProseCode:                           2:01:25 PM

 - /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/components/Prose/ProseCode.vue
 - /workspace/node_modules/.pnpm/@nuxt-themes+typography@0.11.0_postcss@8.4.28_rollup@3.28.1_vue@3.3.4/node_modules/@nuxt-themes/typography/components/global/ProseCode.vue


 WARN  [nuxt] Two component files resolving to the same name ProseCodeInline:                     2:01:25 PM

 - /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/components/Prose/ProseCodeInline.vue
 - /workspace/node_modules/.pnpm/@nuxt-themes+typography@0.11.0_postcss@8.4.28_rollup@3.28.1_vue@3.3.4/node_modules/@nuxt-themes/typography/components/global/ProseCodeInline.vue


 WARN  [nuxt] Two component files resolving to the same name ProseEm:                             2:01:25 PM

 - /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/components/Prose/ProseEm.vue
 - /workspace/node_modules/.pnpm/@nuxt-themes+typography@0.11.0_postcss@8.4.28_rollup@3.28.1_vue@3.3.4/node_modules/@nuxt-themes/typography/components/global/ProseEm.vue


 WARN  [nuxt] Two component files resolving to the same name ProseH1:                             2:01:25 PM

 - /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/components/Prose/ProseH1.vue
 - /workspace/node_modules/.pnpm/@nuxt-themes+typography@0.11.0_postcss@8.4.28_rollup@3.28.1_vue@3.3.4/node_modules/@nuxt-themes/typography/components/global/ProseH1.vue


 WARN  [nuxt] Two component files resolving to the same name ProseH2:                             2:01:25 PM

 - /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/components/Prose/ProseH2.vue
 - /workspace/node_modules/.pnpm/@nuxt-themes+typography@0.11.0_postcss@8.4.28_rollup@3.28.1_vue@3.3.4/node_modules/@nuxt-themes/typography/components/global/ProseH2.vue


 WARN  [nuxt] Two component files resolving to the same name ProseH3:                             2:01:25 PM

 - /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/components/Prose/ProseH3.vue
 - /workspace/node_modules/.pnpm/@nuxt-themes+typography@0.11.0_postcss@8.4.28_rollup@3.28.1_vue@3.3.4/node_modules/@nuxt-themes/typography/components/global/ProseH3.vue


 WARN  [nuxt] Two component files resolving to the same name ProseH4:                             2:01:25 PM

 - /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/components/Prose/ProseH4.vue
 - /workspace/node_modules/.pnpm/@nuxt-themes+typography@0.11.0_postcss@8.4.28_rollup@3.28.1_vue@3.3.4/node_modules/@nuxt-themes/typography/components/global/ProseH4.vue


 WARN  [nuxt] Two component files resolving to the same name ProseH5:                             2:01:25 PM

 - /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/components/Prose/ProseH5.vue
 - /workspace/node_modules/.pnpm/@nuxt-themes+typography@0.11.0_postcss@8.4.28_rollup@3.28.1_vue@3.3.4/node_modules/@nuxt-themes/typography/components/global/ProseH5.vue


 WARN  [nuxt] Two component files resolving to the same name ProseH6:                             2:01:25 PM

 - /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/components/Prose/ProseH6.vue
 - /workspace/node_modules/.pnpm/@nuxt-themes+typography@0.11.0_postcss@8.4.28_rollup@3.28.1_vue@3.3.4/node_modules/@nuxt-themes/typography/components/global/ProseH6.vue


 WARN  [nuxt] Two component files resolving to the same name ProseHr:                             2:01:25 PM

 - /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/components/Prose/ProseHr.vue
 - /workspace/node_modules/.pnpm/@nuxt-themes+typography@0.11.0_postcss@8.4.28_rollup@3.28.1_vue@3.3.4/node_modules/@nuxt-themes/typography/components/global/ProseHr.vue


 WARN  [nuxt] Two component files resolving to the same name ProseImg:                            2:01:25 PM

 - /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/components/Prose/ProseImg.vue
 - /workspace/node_modules/.pnpm/@nuxt-themes+typography@0.11.0_postcss@8.4.28_rollup@3.28.1_vue@3.3.4/node_modules/@nuxt-themes/typography/components/global/ProseImg.vue


 WARN  [nuxt] Two component files resolving to the same name ProseLi:                             2:01:25 PM

 - /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/components/Prose/ProseLi.vue
 - /workspace/node_modules/.pnpm/@nuxt-themes+typography@0.11.0_postcss@8.4.28_rollup@3.28.1_vue@3.3.4/node_modules/@nuxt-themes/typography/components/global/ProseLi.vue


 WARN  [nuxt] Two component files resolving to the same name ProseOl:                             2:01:25 PM

 - /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/components/Prose/ProseOl.vue
 - /workspace/node_modules/.pnpm/@nuxt-themes+typography@0.11.0_postcss@8.4.28_rollup@3.28.1_vue@3.3.4/node_modules/@nuxt-themes/typography/components/global/ProseOl.vue


 WARN  [nuxt] Two component files resolving to the same name ProseP:                              2:01:25 PM

 - /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/components/Prose/ProseP.vue
 - /workspace/node_modules/.pnpm/@nuxt-themes+typography@0.11.0_postcss@8.4.28_rollup@3.28.1_vue@3.3.4/node_modules/@nuxt-themes/typography/components/global/ProseP.vue


 WARN  [nuxt] Two component files resolving to the same name ProseStrong:                         2:01:25 PM

 - /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/components/Prose/ProseStrong.vue
 - /workspace/node_modules/.pnpm/@nuxt-themes+typography@0.11.0_postcss@8.4.28_rollup@3.28.1_vue@3.3.4/node_modules/@nuxt-themes/typography/components/global/ProseStrong.vue


 WARN  [nuxt] Two component files resolving to the same name ProseTable:                          2:01:25 PM

 - /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/components/Prose/ProseTable.vue
 - /workspace/node_modules/.pnpm/@nuxt-themes+typography@0.11.0_postcss@8.4.28_rollup@3.28.1_vue@3.3.4/node_modules/@nuxt-themes/typography/components/global/ProseTable.vue


 WARN  [nuxt] Two component files resolving to the same name ProseTbody:                          2:01:25 PM

 - /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/components/Prose/ProseTbody.vue
 - /workspace/node_modules/.pnpm/@nuxt-themes+typography@0.11.0_postcss@8.4.28_rollup@3.28.1_vue@3.3.4/node_modules/@nuxt-themes/typography/components/global/ProseTbody.vue


 WARN  [nuxt] Two component files resolving to the same name ProseTd:                             2:01:25 PM

 - /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/components/Prose/ProseTd.vue
 - /workspace/node_modules/.pnpm/@nuxt-themes+typography@0.11.0_postcss@8.4.28_rollup@3.28.1_vue@3.3.4/node_modules/@nuxt-themes/typography/components/global/ProseTd.vue


 WARN  [nuxt] Two component files resolving to the same name ProseTh:                             2:01:25 PM

 - /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/components/Prose/ProseTh.vue
 - /workspace/node_modules/.pnpm/@nuxt-themes+typography@0.11.0_postcss@8.4.28_rollup@3.28.1_vue@3.3.4/node_modules/@nuxt-themes/typography/components/global/ProseTh.vue


 WARN  [nuxt] Two component files resolving to the same name ProseThead:                          2:01:25 PM

 - /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/components/Prose/ProseThead.vue
 - /workspace/node_modules/.pnpm/@nuxt-themes+typography@0.11.0_postcss@8.4.28_rollup@3.28.1_vue@3.3.4/node_modules/@nuxt-themes/typography/components/global/ProseThead.vue


 WARN  [nuxt] Two component files resolving to the same name ProseTr:                             2:01:25 PM

 - /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/components/Prose/ProseTr.vue
 - /workspace/node_modules/.pnpm/@nuxt-themes+typography@0.11.0_postcss@8.4.28_rollup@3.28.1_vue@3.3.4/node_modules/@nuxt-themes/typography/components/global/ProseTr.vue


 WARN  [nuxt] Two component files resolving to the same name ProseUl:                             2:01:25 PM

 - /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/components/Prose/ProseUl.vue
 - /workspace/node_modules/.pnpm/@nuxt-themes+typography@0.11.0_postcss@8.4.28_rollup@3.28.1_vue@3.3.4/node_modules/@nuxt-themes/typography/components/global/ProseUl.vue

ℹ Vite client warmed up in 6836ms                                                                2:01:33 PM

[2:01:34 PM]  WARN  (node-resolve plugin) Could not resolve import "micromark/lib/preprocess.js" in /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/transformers/csv/from-csv.mjs using exports defined in /workspace/node_modules/.pnpm/micromark@4.0.0/node_modules/micromark/package.json.


[2:01:34 PM]  WARN  (node-resolve plugin) Could not resolve import "micromark/lib/postprocess.js" in /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/transformers/csv/from-csv.mjs using exports defined in /workspace/node_modules/.pnpm/micromark@4.0.0/node_modules/micromark/package.json.


[2:01:34 PM]  WARN  (node-resolve plugin) Could not resolve import "micromark/lib/preprocess.js" in /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/transformers/csv/from-csv.mjs using exports defined in /workspace/node_modules/.pnpm/micromark@4.0.0/node_modules/micromark/package.json.


[2:01:34 PM]  WARN  (node-resolve plugin) Could not resolve import "micromark/lib/postprocess.js" in /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/transformers/csv/from-csv.mjs using exports defined in /workspace/node_modules/.pnpm/micromark@4.0.0/node_modules/micromark/package.json.


[2:01:34 PM]  WARN  (node-resolve plugin) Could not resolve import "micromark/lib/preprocess.js" in /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/transformers/csv/from-csv.mjs using exports defined in /workspace/node_modules/.pnpm/micromark@4.0.0/node_modules/micromark/package.json.


[2:01:34 PM]  WARN  (node-resolve plugin) Could not resolve import "micromark/lib/postprocess.js" in /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/transformers/csv/from-csv.mjs using exports defined in /workspace/node_modules/.pnpm/micromark@4.0.0/node_modules/micromark/package.json.


[2:01:34 PM]  WARN  (node-resolve plugin) Could not resolve import "micromark/lib/preprocess.js" in /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/transformers/csv/from-csv.mjs using exports defined in /workspace/node_modules/.pnpm/micromark@4.0.0/node_modules/micromark/package.json.


[2:01:34 PM]  WARN  (node-resolve plugin) Could not resolve import "micromark/lib/postprocess.js" in /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/transformers/csv/from-csv.mjs using exports defined in /workspace/node_modules/.pnpm/micromark@4.0.0/node_modules/micromark/package.json.


[2:01:34 PM]  WARN  (node-resolve plugin) Could not resolve import "micromark/lib/preprocess.js" in /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/transformers/csv/from-csv.mjs using exports defined in /workspace/node_modules/.pnpm/micromark@4.0.0/node_modules/micromark/package.json.


[2:01:34 PM]  WARN  "micromark/lib/preprocess.js" is imported by "node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/transformers/csv/from-csv.mjs", but could not be resolved – treating it as an external dependency.


[2:01:34 PM]  WARN  (node-resolve plugin) Could not resolve import "micromark/lib/postprocess.js" in /workspace/node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/transformers/csv/from-csv.mjs using exports defined in /workspace/node_modules/.pnpm/micromark@4.0.0/node_modules/micromark/package.json.


[2:01:34 PM]  WARN  "micromark/lib/postprocess.js" is imported by "node_modules/.pnpm/@nuxt+content@2.7.2_rollup@3.28.1/node_modules/@nuxt/content/dist/runtime/transformers/csv/from-csv.mjs", but could not be resolved – treating it as an external dependency.

✔ Nitro built in 2870 ms                                                                   nitro 2:01:35 PM

[2:01:35 PM]  ERROR  [worker reload] [worker init] Package subpath './lib/preprocess.js' is not defined by "exports" in /workspace/node_modules/micromark/package.json imported from /workspace/.nuxt/dev/index.mjs

  at __node_internal_captureLargerStackTrace (node:internal/errors:490:5)
  at new NodeError (node:internal/errors:399:5)
  at exportsNotFound (node:internal/modules/esm/resolve:361:10)
  at packageExportsResolve (node:internal/modules/esm/resolve:697:9)
  at packageResolve (node:internal/modules/esm/resolve:872:14)
  at moduleResolve (node:internal/modules/esm/resolve:938:20)
  at defaultResolve (node:internal/modules/esm/resolve:1153:11)
  at nextResolve (node:internal/modules/esm/loader:163:28)
  at ESMLoader.resolve (node:internal/modules/esm/loader:838:30)
  at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
  at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:77:40)
  at link (node:internal/modules/esm/module_job:76:36)

^C ELIFECYCLE  Command failed.

Example code

https://codesandbox.io/p/sandbox/upbeat-chebyshev-639jvp

Environment

Codesandbox

------------------------------
- Operating System: Linux
- Node Version:     v16.17.0
- Nuxt Version:     3.7.0
- CLI Version:      3.7.0
- Nitro Version:    2.6.1
- Package Manager:  pnpm@7.1.0
- Builder:          -
- User Config:      extends, modules
- Runtime Modules:  @nuxtjs/plausible@0.2.1, @nuxt/devtools@0.6.7
- Build Modules:    -
------------------------------

Dev machine

------------------------------
- Operating System: Windows_NT
- Node Version:     v18.16.1
- Nuxt Version:     3.7.0
- CLI Version:      3.7.0
- Nitro Version:    2.6.1
- Package Manager:  pnpm@8.7.0
- Builder:          -
- User Config:      extends, modules
- Runtime Modules:  @nuxtjs/plausible@0.2.1, @nuxt/devtools@0.8.0
- Build Modules:    -
------------------------------

Additional context

When installing with npm, there also a lot of warnings, but no errors, and it runs.

Also, I think I managed to get it to work with the following steps:

  1. Add strict-peer-dependencies=false to .npmrc
  2. Delete pnpm-lock.yaml and node_modules (if exists)
  3. Install everything with npm
  4. Delete node_modules again
  5. Run pnpm import
@Hecatron
Copy link

Hecatron commented Aug 29, 2023

I think the cause is the use of micromark 4.0.0 via nuxt content
as a workaround I managed to get it working by overriding the version to the one prior by adding the following to package.json

  "pnpm": {
    "overrides": {
      "micromark": "3.2.0"
    }
  }

I suspect this is also related to the below issue, as I was seeing the same errors as well at the same time
as soon as I moved micromark from 4.0.0 to 3.2.0 it seemed to disapear.

Looks like its being pulled in via remark-mdc 1.2.0
which is in turn pulled in by nuxt content 2.7.2

It looks like the main branch of nuxt content also has it listed as a dependency although that hasn't made it's way through to a release yet, but it's still being pulled in via remark-mdc

my guess is when remark-mdc was upped from 1.1.3 to 1.2.0 that's when it made it's way in
as 1.1.3 was using micromark 3.1.0 but 1.2.0 moved to micromark 4.0.0

@brawaru
Copy link
Author

brawaru commented Aug 29, 2023

@grbd nuxt/content#2254 (comment) seems to be alternative solution that doesn't involve overriding versions. Haven't tried it yet though Tried it, and it works! However there are some issues with this approach over just overriding the version.

@Hecatron
Copy link

@grbd nuxt/content#2254 (comment) seems to be alternative solution that doesn't involve overriding versions. Haven't tried it yet though Tried it, and it works! However there are some issues with this approach over just overriding the version.

Yep confirmed the alias approach works for me too with pnpm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants