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.
Render doesn’t require anything other than what your application references. Render by default doesn’t install devDependencies because if NODE_ENV is undefined by you it defaults to production, which doesn’t install devDependencies.
I don’t know much about TypeScript, it seems like their flow expects generated assets to be deployed, and not running the various TypeScript processes remotely. I disagree with this expectation, but I don’t have enough experience to be able to explain it nor refute it.
The takeaway that I generally give out continues to apply here: If you run TypeScript compilation processes on Render, it’s not a dev dependency.
I’m also running in this issues. After installing @types/node as a devDependency the build still fails. The same project deployed on Vercel works well.