Typescript build fails - incorrect type inference
Hello, trying to build the project https://github.com/datner/renu with NixPaxks 1.6.1. It used to be working fine. But recently started to get Typescript errors that do not happen on local build. Typescript is inferring wrong types to variables.
Anyone familiar with something like that?
36 Replies
Project ID:
N/A
N/A
This issue happens locally as well as on Codebuild/Flightcontrol
Interesting. What version of Nixpacks did it last work?
Locally with nixpacks?
I am having issues building the repo locally (without Nixpacks).
It seems like the repo needs a very specific version Node (18.13 doesn't work but 18.15 gets further in the build?). I see the typescript error when using Nixpacks locally, but being unable to get it to build locally without Nixpacks makes me think that it is a code issue
Yes
Ah ok but it’s fine building with tsc in a local environment?
What node version are you using
So builds locally without NixPacks
Fails to build locally with NixPacks
What node version
Without NixPacks 18.15 or 18.16 work
With NixPacks I can only get 18.12
Do you use any global packages
Dockerfile will fix that issue
You mean build using Dockerfile? Yeah sure, but this is not my goal coming here 😅
thats fair, might be best to fix the code issue than
Yeah I mean that will fix the problem but like jr said if you need a specific version it might be a code issue
or code incompatibilities
Yeah
Can you send the typescript error you’re getting
Please
alex sleeps and breaths ts
Heheheha
Nice gitignore
@Brody ^
oof
@alex and @Brody
Here is the correct type of an object:
What is the error tho
here is the error:
look again later
exactly, it something very odd and does not make sense
This is due to the Nixpkgs archive being an older version. You can change it via a
nixpacks.toml
file. For example
Although I don't know why the node version would be causing a TypeScript errorIt shouldn’t
That’s the thing
Any 18.xx should be compatible with any 18.xx code
would that bring a new Node version @jr, I can try it
But as @alex mentioned, I do not think it is a node verion
18.12 builds fine outside NixPacks
Could it be an environment variable? Nixpacks sets the following for now
-
NODE_ENV=production
- NPM_CONFIG_PRODUCTION=false
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Hmm I'm really not sure. I still suspect it is a version issue. TypeScript is completing successfully, but it just has the wrong information and is reporting an error when it shouldn't
Do you have a Dockerfile that works to build the project? I am trying
But am seeing this error
I was able to reproduce the issue here:
I am getting the same error as NixPacks
Core pack is installed by default isn’t it?
If so, that is great to know! I was scratching my head for this one