How to replicate typescript build error in local env?

I’m blocked from building my app due to a typescript error that only occurs in my netlify production build.

11:39:14 AM:         Type "boolean | undefined" is not assignable to type "boolean".
11:39:14 AM:           Type "undefined" is not assignable to type "boolean".

Having spent days on this already I’ve read other Netlify Support posts, solutions, etc. but the issue seems intractable. I accept that this is a legit warning generated by my code I simply can’t get the error to occur locally and therefore can’t validate potential fixes.

Not looking for answers about how to address the warning, my question is: what does the Netlify prod build do differently from a local ‘npm run build’ ?

It’s unlikely this would happen only on Netlify. We don’t run our own TypeScript or change any of your configurations. If TypeScript is reporting this, it would very likely be a problem in your codebase and if not, feel free to share a minimal reproduction.

Thanks for the reply. I agree it’s a problem in my codebase. Where I’m struggling is that I don’t see any warnings locally and it builds fine, it also builds fine on my Netlify dev environment, but production hits this error.

I don’t know a way to minimally reproduce the issue and am not comfortable publicly sharing details. If there’s a better way to engage support then I’ll try there.

As a Pro user you can also write in to the helpdesk: Support (

However, we’d still need the same details that we asked for here. As for how to get this error locally, can you confirm you’ve run tsc (or npx tsc) locally?