Typescript compiling is more strict

this is a weird one…

When building/deploying via Netlify, typescript compilation produces more errors than I see locally. They’re legitimate ts errors, but tsc succeeds locally and my dev server (reactjs) runs.

I’ve added some debugging lines, such as: show the typescript version, verify working directory, cat tsconfig file contents
I run the exact same yarn script locally.
I tried switching NODE_ENV back and forth between"production" and “development”.
I tried the “netlify dev” local pipeline.
The true Netlify build pipeline produces more errors

We do use lerna, and build multiple packages, so it’s not a simple situation to reproduce.

any ideas?
–thanks

Hi, have you verified that you’re using the same version of typescript locally as you are in our build environment? We don’t have Typescript in our build environment by default so it’s installed along with the rest of your dependencies using the versions in your package.json. It also will just use your tsconfig file so there isn’t anything we do specially that would make it more “strict”.

yes, all exactly the same. I was hoping you could shed some light on any environment details. Any chance you could share your setup scripts? maybe a docker file if you use that?

thanks

Not just a chance, already open source :slight_smile:

Start here for instructions on using our docker container:

1 Like