Open ageha734 opened 1 year ago
Did you install the packages?
Yes. Installed and used.
I'm unsure, maybe next does something strange to the paths but that seems unlikely
I think the proper setting is
"extends":"@tsconfig/next/tsconfig.json"
but is there any other place to set it?
Nope that goes in your tsconfig
@ageha734 the issue is with Next.js. It expects an include
key in your tsconfig.json. Instead of
{
"extends": "@tsconfig/next/tsconfig.json"
}
you need something like this
{
"extends": "@tsconfig/next/tsconfig.json",
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}
Generally, it seems like this package doesn't play that well with Next.js expectations which does a lot of checks and automatic injection into your tsconfig.json and so it's probably better to just copy and paste from https://github.com/tsconfig/bases/blob/main/bases/next.json manually.
Error1
tsconfig:
TypeScript 5 have the following error:
TypeError: Cannot read properties of undefined (reading 'push') at writeConfigurationDefaults (/node_modules/next/dist/lib/typescript/writeConfigurationDefaults.js:227:30) at async verifyTypeScriptSetup (/node_modules/next/dist/lib/verifyTypeScriptSetup.js:120:9) at async DevServer.verifyTypeScript (/node_modules/next/dist/server/dev/next-dev-server.js:648:34) at async DevServer.prepareImpl (/node_modules/next/dist/server/dev/next-dev-server.js:672:9) at async NextServer.prepare /node_modules/next/dist/server/next.js:165:13) at async Server.<anonymous> (/next/dist/server/lib/render-server.js:123:17) { type: 'TypeError' }
Error2
tsconfig:
TypeScript 5 have the following error:
error TS6053: File 'node_modules/@tsconfig/next/tsconfig.json' not found.
Development environment
List of commands executed
pnpm dev
pnpm remove @tsconfig/next
pnpm add -D @tsconfig/next
pnpm dev
summary
I can't build with an error even after changing the path to the Extended Settings file and re-installing.