I am deployed a fresh installation of nextjs using typescript
npx create-next-app@latest foo --ts
When the app is deployed to render the build fails with the error message
It looks like you're trying to use TypeScript but do not have the required package(s) installed.
Please install typescript, @types/react, and @types/node by running:
yarn add --dev typescript @types/react @types/node
If if I move all “devDependencies” to “dependencies” in package.json the build succeeds. But this is not the correct behavior.
As specified in Specifying dependencies and devDependencies in a package.json file | npm Docs * "devDependencies"
: Packages that are only needed for local development and testing. This includes the typescript package and @type packages which should not be included in the final build.
Why does render require these “devDependencies” to be included in the build? This leads to a bloated build package and confusing implementation.
This is easily reproducible by creating a new NextJs app and deploying to render.