I tried to install Nuxt 3 layers inside a monorepo with turborepo. and I somehow get error with typescript where it's seems to not able to figure out nuxt
defineNuxtConfig not find
appConfig not found
the ts config file look like this:
{
"extends": "./.playground/.nuxt/tsconfig.json"
}
and on .playground/.nuxt folder there's tsconfig that look like this(auto-generated):
// Generated by nuxi
{
"compilerOptions": {
"forceConsistentCasingInFileNames": true,
"jsx": "preserve",
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "Node",
"skipLibCheck": true,
"strict": true,
"allowJs": true,
"noEmit": true,
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
"types": [
"node"
],
"baseUrl": "..",
"paths": {
"~": [
"."
],
"~/*": [
"./*"
],
"@": [
"."
],
"@/*": [
"./*"
],
"~~": [
"."
],
"~~/*": [
"./*"
],
"@@": [
"."
],
"@@/*": [
"./*"
],
"assets": [
"assets"
],
"public": [
"public"
],
"#app": [
"../../../node_modules/nuxt/dist/app"
],
"#app/*": [
"../../../node_modules/nuxt/dist/app/*"
],
"vue-demi": [
"../../../node_modules/nuxt/dist/app/compat/vue-demi"
],
"@vueuse/head": [
"../../../node_modules/@unhead/vue/dist/index"
],
"#imports": [
".nuxt/imports"
],
"#build": [
".nuxt"
],
"#build/*": [
".nuxt/*"
],
"#components": [
".nuxt/components"
]
}
},
"include": [
"./nuxt.d.ts",
"../**/*"
],
"exclude": [
"../dist",
"../.output"
]
}
how can i fix this so that defineNuxtConfig is recognized properly?
remove error Cannot find name 'defineNuxtConfig'.ts(2304)
I had the same problem, weirdly enough after trying a few things what fixed it for me was changing the VSCode plugin Volar:Typescript Version to Use workspace version THEN changing back to Use VS Code's Version

How:
F1 or Ctrl + Shift + PVolar: Select Typescript VersionUse workspace versionUse VS Code's VersionBam, all my nuxt3 autoimports are correctly typed, don't know why tho.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With