content icon indicating copy to clipboard operation
content copied to clipboard

Dependencies not found - vue-tsc error

Open FabianMontoya opened this issue 1 year ago • 4 comments

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/[email protected]/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/[email protected]/node_modules/parse5/dist/index.js.map'


[8:24:36 PM]  WARN  Failed to load source map for /Users/<project-path>/node_modules/.pnpm/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected][email protected]/node_modules/vite-node/dist/client.mjs:362:11)
  at ViteNodeRunner.directRequest (node_modules/.pnpm/[email protected][email protected]/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/[email protected][email protected]/node_modules/vite-node/dist/client.mjs:189:14)
  at async ViteNodeRunner.dependencyRequest (node_modules/.pnpm/[email protected][email protected]/node_modules/vite-node/dist/client.mjs:233:12)

FabianMontoya avatar Jun 11 '24 02:06 FabianMontoya

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

farnabaz avatar Jun 13 '24 09:06 farnabaz

@farnabaz I'm also running into this issue after installing nuxt/content 2.13.0.

Without the module, build works - but only after the vue-tsc compatibilities were fixed with the release of Nuxt 3.12.3. See this https://github.com/vuejs/language-tools/issues/3969#issuecomment-2199926247

I guess an update to the content module would also fix the compatibility issues with vue-tsc 2.x ?

For what is worth, the same error again when running a build on GitHub

Node Version: v18.20.3 Nuxt Version: 3.12.3 Nuxt Content: 2.13.0 Typescript: 5.4.5 Vue-tsc: 2.0.24

[info] vite v5.2.11 building for production...
[info] transforming...
/home/runner/work/my-project/node_modules/vue-tsc/bin/vue-tsc.js:68
			throw err;
			^

TypeError: Cannot read properties of undefined (reading 'full')

Cry0nicS avatar Jul 03 '24 09:07 Cry0nicS

@Cry0nicS Do you mind providing a small reproduction? I could not reproduce the issue using content starter

farnabaz avatar Jul 16 '24 09:07 farnabaz

@Cry0nicS Do you mind providing a small reproduction? I could not reproduce the issue using content starter

This was fixed by Nuxt 3.12.3 and vue-tsc 2.0.24

Cry0nicS avatar Jul 29 '24 20:07 Cry0nicS

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Dec 08 '24 02:12 github-actions[bot]