language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

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

Open Archetipo95 opened this issue 1 year ago • 13 comments

After upgrading to v2

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

Archetipo95 avatar Mar 04 '24 11:03 Archetipo95

Cross referencing here since it seems to influence also vite-plugin-checker: https://github.com/fi3ework/vite-plugin-checker/issues/306

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

sullyD64 avatar Mar 04 '24 11:03 sullyD64

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

Rigo-m avatar Mar 04 '24 13:03 Rigo-m

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

danielroe avatar Mar 04 '24 13:03 danielroe

Thanks 🤗

Rigo-m avatar Mar 04 '24 13:03 Rigo-m

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:

gygoo avatar Mar 04 '24 17:03 gygoo

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

davinma avatar Mar 05 '24 05:03 davinma

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/[email protected][email protected][email protected][email protected][email protected]/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/[email protected][email protected]/node_modules/esbuild-register/dist/node.js:4799:36)
      at Function.resolve (node:internal/modules/helpers:187:19)
      at <anonymous> (./node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/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/[email protected][email protected][email protected][email protected][email protected]/node_modules/vite-plugin-checker/src/main.ts:46:37)
      at config (./node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/vite-plugin-checker/src/main.ts:86:18)
      at async runConfigHook (file://./node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-BBHrJRja.js:68541:25)
      at async resolveConfig (file://./node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-BBHrJRja.js:67996:14)

ayZagen avatar Mar 27 '24 12:03 ayZagen

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

Archetipo95 avatar Apr 05 '24 21:04 Archetipo95

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'

Mohamadhassan98 avatar Apr 05 '24 23:04 Mohamadhassan98

I can confirm. Still am issue on my end

genu avatar Apr 05 '24 23:04 genu

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

franklx avatar Apr 06 '24 05:04 franklx

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

kiketordera avatar May 07 '24 16:05 kiketordera

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

thanks it worked for me

luohuiqun avatar May 11 '24 08:05 luohuiqun

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

Issue is still there.

ElysaSrc avatar May 19 '24 10:05 ElysaSrc

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


howbizarre avatar May 20 '24 07:05 howbizarre

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",

prazian avatar May 26 '24 05:05 prazian

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.

vasilistotskas avatar May 27 '24 14:05 vasilistotskas

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

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

yanniznik avatar Jun 10 '24 07:06 yanniznik

Any updates? Still occurring with 2.0.21 and Nuxt 3.12.2

Cry0nicS avatar Jun 17 '24 12:06 Cry0nicS

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

artemrusaleev avatar Jun 20 '24 07:06 artemrusaleev

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 https://github.com/fi3ework/vite-plugin-checker/issues/306.

so1ve avatar Jun 21 '24 13:06 so1ve

https://github.com/fi3ework/vite-plugin-checker/pull/327

so1ve avatar Jun 21 '24 15:06 so1ve

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

howbizarre avatar Jun 26 '24 08:06 howbizarre

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

ennioVisco avatar Jun 26 '24 09:06 ennioVisco

Closing, as https://github.com/fi3ework/vite-plugin-checker/pull/327 had been merged.

so1ve avatar Jun 29 '24 14:06 so1ve

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/[email protected][email protected][email protected][email protected][email protected]/node_modules/vite-plugin-checker/dist/esm/checkers/vueTsc/prepareVueTsc.js

  Require stack:
  - node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/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)

Aietes avatar Jul 01 '24 11:07 Aietes

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

namhtpyn avatar Jul 01 '24 11:07 namhtpyn

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"
    }
  }

Aietes avatar Jul 01 '24 11:07 Aietes

You'll get it soon, in next Nuxt patch - follow https://github.com/nuxt/nuxt/pull/27648.

danielroe avatar Jul 01 '24 11:07 danielroe