nuxt / content

The file-based CMS for your Nuxt application, powered by Markdown and Vue components.
https://content.nuxt.com
MIT License
3k stars 605 forks source link

Dependencies not found - vue-tsc error #2663

Open FabianMontoya opened 2 weeks ago

FabianMontoya commented 2 weeks ago

Environment

Reproduction

https://stackblitz.com/edit/fmontoya-nuxt-content-dependencies-error?file=app.vue

Describe the bug

When I init the app after add the content module and try to render a markdown that comes from a string (I fetched from a CMS), I receive an dependencies error

Additional context

My user case is that I fetch the markdown content from a CMS API, and I have to render it into my Nuxt app, anything else

Logs

[8:24:36 PM]  WARN  Failed to load source map for /Users/<project-path>/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/index.js.
Error: An error occurred while trying to read the map file at index.js.map
Error: ENOENT: no such file or directory, open '/Users/<project-path>/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/index.js.map'

[8:24:36 PM]  WARN  Failed to load source map for /Users/<project-path>/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/tree-adapters/default.js.
Error: An error occurred while trying to read the map file at default.js.map
Error: ENOENT: no such file or directory, open '/Users/<project-path>/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/tree-adapters/default.js.map'

[8:24:36 PM]  WARN  Failed to load source map for /Users/<project-path>/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/serializer/index.js.
Error: An error occurred while trying to read the map file at index.js.map
Error: ENOENT: no such file or directory, open '/Users/<project-path>/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/serializer/index.js.map'

[8:24:36 PM]  WARN  Failed to load source map for /Users/<project-path>/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/parser/index.js.
Error: An error occurred while trying to read the map file at index.js.map
Error: ENOENT: no such file or directory, open '/Users/<project-path>/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/parser/index.js.map'

[8:24:36 PM]  WARN  Failed to load source map for /Users/<project-path>/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/common/error-codes.js.
Error: An error occurred while trying to read the map file at error-codes.js.map
Error: ENOENT: no such file or directory, open '/Users/<project-path>/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/common/error-codes.js.map'

[8:24:36 PM]  WARN  Failed to load source map for /Users/<project-path>/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/common/foreign-content.js.
Error: An error occurred while trying to read the map file at foreign-content.js.map
Error: ENOENT: no such file or directory, open '/Users/<project-path>/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/common/foreign-content.js.map'

[8:24:36 PM]  WARN  Failed to load source map for /Users/<project-path>/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/common/html.js.
Error: An error occurred while trying to read the map file at html.js.map
Error: ENOENT: no such file or directory, open '/Users/<project-path>/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/common/html.js.map'

[8:24:36 PM]  WARN  Failed to load source map for /Users/<project-path>/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/common/token.js.
Error: An error occurred while trying to read the map file at token.js.map
Error: ENOENT: no such file or directory, open '/Users/<project-path>/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/common/token.js.map'

[8:24:36 PM]  WARN  Failed to load source map for /Users/<project-path>/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/tokenizer/index.js.
Error: An error occurred while trying to read the map file at index.js.map
Error: ENOENT: no such file or directory, open '/Users/<project-path>/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/tokenizer/index.js.map'

[8:24:36 PM]  WARN  Failed to load source map for /Users/<project-path>/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/parser/formatting-element-list.js.
Error: An error occurred while trying to read the map file at formatting-element-list.js.map
Error: ENOENT: no such file or directory, open '/Users/<project-path>/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/parser/formatting-element-list.js.map'

[8:24:36 PM]  WARN  Failed to load source map for /Users/<project-path>/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/parser/open-element-stack.js.
Error: An error occurred while trying to read the map file at open-element-stack.js.map
Error: ENOENT: no such file or directory, open '/Users/<project-path>/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/parser/open-element-stack.js.map'

[8:24:36 PM]  WARN  Failed to load source map for /Users/<project-path>/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/common/doctype.js.
Error: An error occurred while trying to read the map file at doctype.js.map
Error: ENOENT: no such file or directory, open '/Users/<project-path>/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/common/doctype.js.map'

[8:24:36 PM]  WARN  Failed to load source map for /Users/<project-path>/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/common/unicode.js.
Error: An error occurred while trying to read the map file at unicode.js.map
Error: ENOENT: no such file or directory, open '/Users/<project-path>/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/common/unicode.js.map'

[8:24:36 PM]  WARN  Failed to load source map for /Users/<project-path>/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/tokenizer/preprocessor.js.
Error: An error occurred while trying to read the map file at preprocessor.js.map
Error: ENOENT: no such file or directory, open '/Users/<project-path>/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/tokenizer/preprocessor.js.map'

✔ Vite server hmr 14 files in 472.062ms

 WARN  [Vue Router warn]: uncaught error during route navigation:

 ERROR  Cannot find module './emojis'
Require stack:
- /Users/<project-path>/emojilib

  Require stack:
  - emojilib
  at Function._resolveFilename (node:internal/modules/cjs/loader:1143:15)
  at Function._load (node:internal/modules/cjs/loader:984:27)
  at Module.require (node:internal/modules/cjs/loader:1231:19)
  at require (node:internal/modules/helpers:179:18)
  at emojilib:2:8
  at ViteNodeRunner.runModule (node_modules/.pnpm/vite-node@1.6.0_sass@1.77.4/node_modules/vite-node/dist/client.mjs:362:11)
  at ViteNodeRunner.directRequest (node_modules/.pnpm/vite-node@1.6.0_sass@1.77.4/node_modules/vite-node/dist/client.mjs:346:16)
  at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  at async ViteNodeRunner.cachedRequest (node_modules/.pnpm/vite-node@1.6.0_sass@1.77.4/node_modules/vite-node/dist/client.mjs:189:14)
  at async ViteNodeRunner.dependencyRequest (node_modules/.pnpm/vite-node@1.6.0_sass@1.77.4/node_modules/vite-node/dist/client.mjs:233:12)
farnabaz commented 1 week ago

Did you use shamefully-hoist=true in .npmrc ? If not, try to add shamefully-hoist=true to .npmrc