Ignoring Typescript errors and getting compiled successfully with errors
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
import { NextApiRequest, NextApiResponse } from 'next'
const handler = (req: NextApiRequest, res: NextApiResponse) => {
res.go = 200
res.json({ name: 'John Doe' })
}
export default handler
Vs code shows res.go as an error because it's an error but next.js v 9.4.4 is compiling it successfully 9.2 is fine and throwing errors in my project
Could you please share a full project? Including your tsconfig.json?
It's one of your examples itself actually while doing npx create-next-app I selected with-typescript and deliberately entered wrong Types for res as mentioned above and it compiled successfully while the same doesn't get compiled with create-react-app typescript template and also next 9.2 sometimes compile it successfully and sometimes shows typescript errors
TypeScript errors are not shown during development time (next dev) and during production build (next build).
It is getting shown for V 9.2 at least while running next dev
Yes, the behavior changed in 9.4 for the Fast Refresh experience!
I don't foresee why having compile-time errors while running dev isn't a good feature, Cause I personally find that feature in create-react-app really good
Most helpful comment
I don't foresee why having compile-time errors while running dev isn't a good feature, Cause I personally find that feature in create-react-app really good