Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find type definition file for 'yup'. The file is in the program because: Entry point for implicit type library 'yup'

tsconfig.json
{
    "compilerOptions": {
        "sourceMap": true,
        "outDir": "dist",
        "target": "es5",
        "lib": ["es6", "dom", "dom.iterable", "esnext"],
        "allowJs": true,
        "skipLibCheck": true,
        "strict": true,
        "forceConsistentCasingInFileNames": true,
        "noEmit": true,
        "incremental": true,
        "esModuleInterop": true,
        "module": "esnext",
        "moduleResolution": "node",
        "resolveJsonModule": true,
        "isolatedModules": true,
        "jsx": "preserve",
        "noImplicitAny": true,
        "noImplicitThis": true,
        "strictNullChecks": true
    },
    "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
    "exclude": ["node_modules"]
}


I got this error in my tsconfig.json so due to this error i couldn't run "npm run build" this command when i build my nextjs project.Is anyone know to fixed this?

like image 303
Rukshan Athapaththu Avatar asked Jul 10 '26 05:07

Rukshan Athapaththu


1 Answers

Add this line to tsconfig.json file inside compilerOptions object.

"typeRoots": ["node_modules/yup"]
like image 142
Rukshan Athapaththu Avatar answered Jul 11 '26 20:07

Rukshan Athapaththu