Can't deploy a TypeScript app: tsc not found

Hello! I have a simple Vite (React + Typescript) app I'm trying to deploy on Cloudflare Pages. I have my git repo hooked up, but when I push, the dependencies all install correctly, it correctly runs npm run build, and I then get sh: 1: tsc: not found.
5 Replies
mdierker
mdierkerOP16mo ago
"typescript": "^5.0.2", is in my package.json and I've tried it in both devDependencies and regular dependencies.
mdierker
mdierkerOP16mo ago
Full deploy log from a sample deployment
mdierker
mdierkerOP16mo ago
Any tips? lol -- after hours of debugging, the problem was that I was using the default npm run build when it should have been yarn build. 🤦‍♂️ Works on my local machine presumably because I have global TypeScript installed. TIL those aren't equivalent.
Hello, I’m Allie!
Are you using yarn in your project? If so, then I don’t think the builder installs NPM…
nat20sFruitBat07Dad
I think there is something else going on here. Are you saying that yarn is the only option?
Want results from more Discord servers?
Add your server