TypeError: Cannot read properties of undefined (reading 'push') at writeConfigurationDefaults (/home/anonymous/ProjectName/node_modules/next/dist/lib/typescript/writeConfigurationDefaults.js:223:30) at async verifyTypeScriptSetup (/home/anonymous/ProjectName/node_modules/next/dist/lib/verifyTypeScriptSetup.js:120:9) at async DevServer.verifyTypeScript (/home/anonymous/ProjectName/node_modules/next/dist/server/dev/next-dev-server.js:648:34) at async DevServer.prepareImpl (/home/anonymous/ProjectName/node_modules/next/dist/server/dev/next-dev-server.js:672:9) at async NextServer.prepare (/home/anonymous/ProjectName/node_modules/next/dist/server/next.js:157:13) at async Server.<anonymous> (/home/anonymous/ProjectName/node_modules/next/dist/server/lib/render-server.js:121:17) { type: 'TypeError' }
npm run dev or npm run buildTLDR;
0. You probably don't have an include directive in you config.
tsconfig.json"include": [] directive to your tsconfig.json file, and run dev. Next hijacks your file and adds some of its own types to your config.I found this issue as well today. It seems not having an include directive in your child tsconfig.json file causes this error, which seems like a bug. The logic in writeConfigurationDefaults assumes an include key on the config object exists. What is strange is that the base config does have an include directive but this part of the code for whatever reason has not picked it up so the error occurs.
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