When deploying a Next.js project with TypeScript, sometimes errors occur that do not show up during development. Here is an example of such an error:
13:09:26 Failed to compile.
13:09:26 ./node_modules/next/dist/build/webpack/plugins/pages-manifest-plugin.d.ts:1:34
13:09:26 Type error: Could not find a declaration file for module 'webpack'. '/vercel/36bc1d70/node_modules/webpack/lib/webpack.js' implicitly has an 'any' type.
13:09:26 Try `npm install @types/webpack` if it exists or add a new declaration (.d.ts) file containing `declare module 'webpack';`
13:09:26 [0m[31m[1m>[22m[39m[90m 1 | [39m[36mimport[39m { [33mCompiler[39m[33m,[39m [33mPlugin[39m } from [32m'webpack'[39m[33m;[39m[0m
13:09:26 [0m [90m | [39m [31m[1m^[22m[39m[0m
13:09:26 [0m [90m 2 | [39m[36mexport[39m declare type [33mPagesManifest[39m [33m=[39m {[0m
13:09:26 [0m [90m 3 | [39m [page[33m:[39m string][33m:[39m string[33m;[39m[0m
13:09:26 [0m [90m 4 | [39m}[33m;[39m[0m
13:09:26 error Command failed with exit code 1.
13:09:26 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
13:09:26 Error: Command "yarn run vercel-build" exited with 1
13:09:28 Done with "package.json"