Deploy is hitting Typescript Errors, but Yarn Run build and yarn run lint don't produce these errors

I'm trying to debug an issue where I can yarn build, and yarn lint locally and all is fine, but when I deploy it hits a Typescript error in one of the NodeJS Packages. Error is the following: globalThis.Headers is not a constructor I'm not super familiar with Nixpacks but I did what was written in the docs to make sure I have a similar Node Version: Specifying the engines.node field in package.json I changed that to:
"engines": {
"node": "18"
},
"devDependencies": {
"@tsconfig/recommended": "^1.0.1",
"dts-cli": "^1.6.0",
"husky": "^8.0.1",
"tslib": "^2.4.0",
"typescript": "^4.8.3"
},
"dependencies": {
"@bull-board/api": "^4.2.2",
"@bull-board/fastify": "^4.2.2",
"@bull-board/ui": "^4.2.2",
"@prisma/client": "4.9.0",
"axios": "^1.2.3",
"bullmq": "^1.90.2",
"envsafe": "^2.0.3",
"fastify": "^4.5.3",
"gpt3-tokenizer": "^1.1.4",
"nodemon": "^2.0.20",
"openai": "^3.1.0",
"pinecone-client": "^1.0.1",
"prisma": "^4.9.0",
"sequelize": "^6.28.0"
}
"engines": {
"node": "18"
},
"devDependencies": {
"@tsconfig/recommended": "^1.0.1",
"dts-cli": "^1.6.0",
"husky": "^8.0.1",
"tslib": "^2.4.0",
"typescript": "^4.8.3"
},
"dependencies": {
"@bull-board/api": "^4.2.2",
"@bull-board/fastify": "^4.2.2",
"@bull-board/ui": "^4.2.2",
"@prisma/client": "4.9.0",
"axios": "^1.2.3",
"bullmq": "^1.90.2",
"envsafe": "^2.0.3",
"fastify": "^4.5.3",
"gpt3-tokenizer": "^1.1.4",
"nodemon": "^2.0.20",
"openai": "^3.1.0",
"pinecone-client": "^1.0.1",
"prisma": "^4.9.0",
"sequelize": "^6.28.0"
}
Anyone have any ideas what might be going on here? It's still erroring out when I deploy to Railway
7 Replies
Percy
Percy2y ago
Project ID: N/A
niconico6710
niconico6710OP2y ago
I'm confused as to why in the build logs Nixpacks still looks like it's not using the Engines value provided?
niconico6710
niconico6710OP2y ago
niconico6710
niconico6710OP2y ago
ah ok it did use it
niconico6710
niconico6710OP2y ago
niconico6710
niconico6710OP2y ago
And we're up1 I solved the issue for the typescript error - it was indeed the nodeversion that Nixpacks uses by default. I'm curious why y'all opted for such a low Node version - I think it was set to 12 by default?
Want results from more Discord servers?
Add your server