All of a sudden, my Next.js deployment to Vercel stopped working after the latest deploy and started complaining about not having @types/react AND typescript installed.
It looks like you're trying to use TypeScript but do not have the required package(s) installed.
Please install typescript and @types/react by running:
npm install --save-dev typescript @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).
In my project I am using:
"@types/react": "18.2.15",
"typescript": "5.1.6"
I did not modify these packages at all in the failed deployment. The only change I made to the dependencies was adding cheerio. I tried rebuilding the package.json as well and that did not get rid of this error.
I came across this old post with almost the same issue. However since it is outdated I decided to open a new question for 2023. The old solution was downgrading the @types/react version but it does not work for me.
How can I get past this blocker? Thanks