can't find module "types/nav"
Answered
QBit posted this in #help-forum
11 Replies
QBitOP
how to solve it?
@QBit I already have types/nav in my next.js app then why error? You can see in image.
show your tsconfig.json
QBitOP
{
"compilerOptions": {
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}then it is
@/types/nav not types/navAnswer
also you probably need to add
"baseUrl": "." in compilerOptionsQBitOP
why to add baseUrl?
does
@/types/nav work without baseurl? ive seen people getting it to work without, but also people who need baseurlQBitOP
yeah,
@/types/nav working without baseurl (not showing red highlight)yes then good
QBitOP
cool
thanks!!