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

ERROR Cannot start nuxt: Cannot find module 'vue-tsc/out/index' #3969

Closed
Tracked by #159
Archetipo95 opened this issue Mar 4, 2024 · 33 comments
Closed
Tracked by #159

ERROR Cannot start nuxt: Cannot find module 'vue-tsc/out/index' #3969

Archetipo95 opened this issue Mar 4, 2024 · 33 comments
Labels
question Further information is requested

Comments

@Archetipo95
Copy link

Archetipo95 commented Mar 4, 2024

ERROR Cannot start nuxt: Cannot find module 'vue-tsc/out/index' after upgrading to v2

I'm using Nuxt 3 latest with a monorepo config (nuxt layers)

The only solution currently is to downgrade as suggested by @davinma
Downgrade "vue-tsc": "^2.0.4" to "vue-tsc": "^1.8.22"

@sullyD64
Copy link

sullyD64 commented Mar 4, 2024

Cross referencing here since it seems to influence also vite-plugin-checker: fi3ework/vite-plugin-checker#306

I think we need an upgrade path for libraries consuming vue-tsc v2.

@Rigo-m
Copy link

Rigo-m commented Mar 4, 2024

@danielroe does this require an issue tracking in the nuxt repo?

@danielroe
Copy link
Member

Nuxt doesn't directly consume vue-tsc and I think vite-plugin-checker (which we use) is already aware.

@Rigo-m
Copy link

Rigo-m commented Mar 4, 2024

Thanks 🤗

@gygoo
Copy link

gygoo commented Mar 4, 2024

I have the same issue:
ERROR Cannot start nuxt: Cannot find module 'vue-tsc/out/index'

Stack:
"nuxt": "^3.10.3",
"vue-tsc": "^2.0.4"

Require stack:

  • .../app-template/node_modules/.pnpm/vite-plugin-checker@0.6.4_eslint@8.57.0_stylelint@16.2.1_typescript@5.3.3_vite@5.1.4_vue-tsc@2.0.4/node_modules/vite-plugin-checker/dist/esm/checkers/vueTsc/prepareVueTsc.js

@davinma
Copy link

davinma commented Mar 5, 2024

Downgrade "vue-tsc": "^2.0.4" to "vue-tsc": "^1.8.22", I have tried it and worked.

@ayZagen
Copy link

ayZagen commented Mar 27, 2024

this error also occurs with storybook build.

> storybook build
  
  @storybook/cli v8.0.4
  
  info => Cleaning outputDir: storybook-static
  info => Loading presets
  info => Building manager..
  info => Manager built (290 ms)
  info => Building preview..
  info => Copying static files: stories/public at storybook-static
  => Failed to build the preview
  Error: Cannot find module 'vue-tsc/out/index'
  Require stack:
  - ./node_modules/.pnpm/vite-plugin-checker@0.6.4_eslint@8.57.0_typescript@5.3.3_vite@5.2.6_vue-tsc@2.0.7/node_modules/vite-plugin-checker/dist/esm/checkers/vueTsc/prepareVueTsc.js
      at Module._resolveFilename (node:internal/modules/cjs/loader:[114](https://github.com/PlusAuth/plusauth-widget/actions/runs/8451989016/job/23151446690#step:5:116)4:15)
      at Module._resolveFilename (./node_modules/.pnpm/esbuild-register@3.5.0_esbuild@0.19.12/node_modules/esbuild-register/dist/node.js:4799:36)
      at Function.resolve (node:internal/modules/helpers:187:19)
      at <anonymous> (./node_modules/.pnpm/vite-plugin-checker@0.6.4_eslint@8.57.0_typescript@5.3.3_vite@5.2.6_vue-tsc@2.0.7/node_modules/vite-plugin-checker/src/checkers/vueTsc/prepareVueTsc.ts:14:31)
      at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
      at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
      at createCheckers (./node_modules/.pnpm/vite-plugin-checker@0.6.4_eslint@8.57.0_typescript@5.3.3_vite@5.2.6_vue-tsc@2.0.7/node_modules/vite-plugin-checker/src/main.ts:46:37)
      at config (./node_modules/.pnpm/vite-plugin-checker@0.6.4_eslint@8.57.0_typescript@5.3.3_vite@5.2.6_vue-tsc@2.0.7/node_modules/vite-plugin-checker/src/main.ts:86:18)
      at async runConfigHook (file://./node_modules/.pnpm/vite@5.2.6_@types+node@20.11.19_terser@5.30.0/node_modules/vite/dist/node/chunks/dep-BBHrJRja.js:68541:25)
      at async resolveConfig (file://./node_modules/.pnpm/vite@5.2.6_@types+node@20.11.19_terser@5.30.0/node_modules/vite/dist/node/chunks/dep-BBHrJRja.js:67996:14)

@Archetipo95
Copy link
Author

Looks like the latest version "vue-tsc": "^2.0.10" is working fine with "nuxt": "^3.11.2"

@Mohamadhassan98
Copy link

Looks like the latest version "vue-tsc": "^2.0.10" is working fine with "nuxt": "^3.11.2"

Not exactly. I've just upgraded nuxt and vue-tsc to latest versions (same as you said) and the error persists:

Cannot start nuxt: Cannot find module 'vue-tsc/out/index'

@genu
Copy link

genu commented Apr 5, 2024

I can confirm. Still am issue on my end

@franklx
Copy link

franklx commented Apr 6, 2024

I can confirm too: problem persists even with a simple vue-tsc --noEmit invocation

@kiketordera
Copy link

kiketordera commented May 7, 2024

Confirmed, problem remains in "^3.11.2", and "vue-tsc": "^2.0.16"

@luohuiqun
Copy link

Downgrade "vue-tsc": "^2.0.4" to "vue-tsc": "^1.8.22", I have tried it and worked.

thanks it worked for me

@ElysaSrc
Copy link

ElysaSrc commented May 19, 2024

Looks like the latest version "vue-tsc": "^2.0.10" is working fine with "nuxt": "^3.11.2"

Issue is still there.

tmtr added a commit to tmtr/nuxt3-get-started that referenced this issue May 20, 2024
* vue-tsc は以下の問題により v1 系を使用
```
You may experience issues with the latest vue-tsc and vite-plugin-checker, used internally when type checking. For now, you may need to stay on v1 of vue-tsc, and follow these upstream issues for updates: fi3ework/vite-plugin-checker#306 and vuejs/language-tools#3969.
```
https://nuxt.com/docs/guide/concepts/typescript#type-checking
@howbizarre
Copy link

Still here with vue-tsc version 2.0.19.

 ERROR  Cannot start nuxt:  Cannot find module 'vue-tsc/out/index'                                                                                                          10:21:56 ч.  
Require stack:
- \node_modules\vite-plugin-checker\dist\esm\checkers\vueTsc\prepareVueTsc.js

  • Operating System: Windows_NT
  • Node Version: v20.12.2
  • Nuxt Version: 3.11.2
  • CLI Version: 3.11.1
  • Nitro Version: 2.9.6
  • Package Manager: npm@10.8.0
  • Builder: -
  • User Config: runtimeConfig, modules, nitro, app, typescript, routeRules, devtools
  • Runtime Modules: @pinia/nuxt@0.5.1, @nuxt/ui@2.16.0, @nuxt/devtools@1.3.1
  • Build Modules: -

@prazian
Copy link

prazian commented May 26, 2024

The issue is still there. Appears when upgrading vue-tsc from 1.8.27 to 2x.

    "nuxt": "^3.11.2",
    "vue": "^3.4.27",
    "vue-router": "^4.3.2",

@vasilistotskas
Copy link

It appears that all Nuxt repositories configured with typescript: { typeCheck: true } and using vue-tsc version 1.8.27 or later are experiencing the same error: vue-tsc/out/index.

@allusernamestakenexceptthis

is this related? I have issue with 3.11.2 and global components like i18T not being recognized by tsc. it occurs only from vue-tsc 1.8.24

here is a reproduction: https://stackblitz.com/edit/github-m5xc5v-gi1rab?file=package.json

abort npm run dev, and run:

npm run typecheck

you'll get error:

error TS2339: Property 'I18nT' does not exist on type '{}'.
3     <I18nT keypath="something">asdfds</I18nT>

now change vue-tsc": "1.8.27" to vue-tsc": "1.8.22" and npm install, now it will work

dddrop added a commit to dddrop/nuxt-layers that referenced this issue Jun 5, 2024
@yanniznik
Copy link

Same issue still happening with Nuxt3 + vue-tsc 2.0.21
Error: Cannot find module 'vue-tsc/out/index'

@Cry0nicS
Copy link

Any updates? Still occurring with 2.0.21 and Nuxt 3.12.2

@artemrusaleev
Copy link

Same issue still happening with Nuxt v3.12.2 and vue-tsc 2.0.21. Any updates?

@so1ve
Copy link
Member

so1ve commented Jun 21, 2024

There is no vue-tsc/out/index in this codebase at all. Could you guys provide a reproduction?

If you are using vite-plugin-checker or nuxt's typeCheck option - sorry it's not an issue on our side: https://github.com/fi3ework/vite-plugin-checker/blob/main/packages/vite-plugin-checker/src/checkers/vueTsc/prepareVueTsc.ts#L14. Please follow fi3ework/vite-plugin-checker#306.

@so1ve
Copy link
Member

so1ve commented Jun 21, 2024

fi3ework/vite-plugin-checker#327

@howbizarre
Copy link

export default defineNuxtConfig({
  typescript: {
    strict: true,
    typeCheck: false
  }
}

Disable type checking at build time and run it from the console or as script in package.json

npx nuxi typecheck

@ennioVisco
Copy link

A fix is on its way, if somebody can help I'm sure it'll be appreciated: fi3ework/vite-plugin-checker#327

@so1ve so1ve added the question Further information is requested label Jun 29, 2024
@so1ve
Copy link
Member

so1ve commented Jun 29, 2024

Closing, as fi3ework/vite-plugin-checker#327 had been merged.

@Aietes
Copy link

Aietes commented Jul 1, 2024

The issue still occurs, it seems the require stack is still using the old vite-plugin-checker release:

 ERROR  Cannot start nuxt:  Cannot find module 'vue-tsc/out/index'                                                                                                                                               1:16:04 PM
Require stack:
- /.../node_modules/.pnpm/vite-plugin-checker@0.6.4_eslint@9.6.0_typescript@5.5.2_vite@5.3.2_vue-tsc@2.0.24/node_modules/vite-plugin-checker/dist/esm/checkers/vueTsc/prepareVueTsc.js

  Require stack:
  - node_modules/.pnpm/vite-plugin-checker@0.6.4_eslint@9.6.0_typescript@5.5.2_vite@5.3.2_vue-tsc@2.0.24/node_modules/vite-plugin-checker/dist/esm/checkers/vueTsc/prepareVueTsc.js
  at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
  at Function.resolve (node:internal/modules/helpers:190:19)

@namhtpyn
Copy link

namhtpyn commented Jul 1, 2024

Yes, if you are using nuxt then you will have to wait for them to upgrade their dependencies

@Aietes
Copy link

Aietes commented Jul 1, 2024

Ok, I hope they'll update soon. For now I'm using an override in my package.json for my nuxt project, which makes it work in the meantime:

  "pnpm": {
    "overrides": {
     "vite-plugin-checker": "0.7.0"
    }
  }

@danielroe
Copy link
Member

You'll get it soon, in next Nuxt patch - follow nuxt/nuxt#27648.

@digitalniweb
Copy link

Looks like it is finally fixed
"nuxt": "^3.12.3",
"vue-tsc": "^2.0.24"

@Aietes
Copy link

Aietes commented Jul 4, 2024

You'll get it soon, in next Nuxt patch - follow nuxt/nuxt#27648.

Thank you! 👍🏻

@richardevcom
Copy link

Had the same error when building my Nuxt 3.14.1592 app.
👉 Fixed it by adding typescript: ~5.6.2 and vue-tsc: 2.1.10 (checked needed versions in vue and nuxt package.json) as dev dependencies in my package.json.

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

No branches or pull requests