[解決] If you are not trying to use TypeScript, please remove the tsconfig.json file from your package root (and any TypeScript files in your pages directory).

[解決] If you are not trying to use TypeScript, please remove the tsconfig.json file from your package root (and any TypeScript files in your pages directory).

If you are not trying to use TypeScript, please remove the tsconfig.json file from your package root (and any TypeScript files in your pages directory).

If you are not trying to use TypeScript, please remove the tsconfig.json file from your package root (and any TypeScript files in your pages directory).

yarn buildすると出る

❯ yarn build
yarn run v1.22.19
$ next build
info - Loaded env from /Users/kenjimorita/git/workspace/todo-app/.env.local
It looks like you're trying to use TypeScript but do not have the required package(s) installed.

Please install @types/react by running:

yarn add --dev @types/react

If you are not trying to use TypeScript, please remove the tsconfig.json file from your package root (and any TypeScript files in your pages directory).

  • なんでtsconfigを削除しないといけないのか...
  • types/reactはすでにあるのに...

言われた通りにやりましたが、
結論、nextを最新バージョンにしたことで治りました

npm install next@latest
npm upgrade react@latest react-dom@latest