R
Railway•11mo ago
Slashiy

Can't compile TypeScript project

For some odd reason I can't compile my TS project on Railway... It just fails everytime with a bunch of type errors from node_modules even though that folder is in my exclude in my tsconfig... I tried with Rollup at first and gave up as I thought it was the problem - turns out it is not after trying with tsc and that also fails... Both images show the problem and I don't know what to do anymore... It compiles just fine locally
No description
No description
Solution:
could you try using an up-to-date version of typescript?
Jump to solution
18 Replies
Percy
Percy•11mo ago
Project ID: N/A
Fragly
Fragly•11mo ago
Those are linting errors, you can choose to fix them or you can disable them by setting CI to false in your service variables
Slashiy
SlashiyOP•11mo ago
N/A oh? I assume that would in the settings somewhere or do I need to look at the docs for that?
Fragly
Fragly•11mo ago
You can click on your service and it'll open up a little window in the window you'll see a Variables tab, this is where you can add Service Variables you can then add a service variable with the name CI set to false to disable linting errors
Slashiy
SlashiyOP•11mo ago
But my initial thought is, why would it ever think to lint inside of node_modules when I have set that to be excluded in my tsconfig
Fragly
Fragly•11mo ago
True, mind sending your full logs? I kinda just guessed based on the images but it's probably better if I investigate fully you can download your logs using this tool: https://bookmarklets.up.railway.app/log-downloader/
Slashiy
SlashiyOP•11mo ago
Let me also send from when I used Rollup
Slashiy
SlashiyOP•11mo ago
This is the when I used Rollup
Slashiy
SlashiyOP•11mo ago
For reference my tsconfig looks like this
No description
Slashiy
SlashiyOP•11mo ago
Yes I know the exclude can just be node_modules and not node_modules/**/* Just tried a bunch of things to see how it would fair
Fragly
Fragly•11mo ago
mind sending me your package.json?
Slashiy
SlashiyOP•11mo ago
yeah 1 sec
{
"name": "mizubot",
"version": "1.0.0",
"main": "index.js",
"author": "Slashiy",
"license": "MIT",
"private": true,
"type": "module",
"scripts": {
"build": "tsc",
"start": "node output/index.js",
"dev": "tsx watch index.ts"
},
"dependencies": {
"@fastify/autoload": "^5.7.1",
"axios": "^1.2.0",
"discord.js": "^14.6.0",
"dotenv": "^16.0.3",
"fastify": "^4.18.0",
"rollup": "^4.9.5",
"tslib": "^2.6.2",
"tsx": "^3.12.7",
"twitter-api-sdk": "^1.2.1",
"twitter-api-v2": "^1.12.9",
"undici": "^5.22.1"
},
"devDependencies": {
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-typescript": "^11.1.6",
"@types/node": "^20.11.2",
"rollup-plugin-node-externals": "^6.1.2",
"typescript": "^4.9.3"
}
}
{
"name": "mizubot",
"version": "1.0.0",
"main": "index.js",
"author": "Slashiy",
"license": "MIT",
"private": true,
"type": "module",
"scripts": {
"build": "tsc",
"start": "node output/index.js",
"dev": "tsx watch index.ts"
},
"dependencies": {
"@fastify/autoload": "^5.7.1",
"axios": "^1.2.0",
"discord.js": "^14.6.0",
"dotenv": "^16.0.3",
"fastify": "^4.18.0",
"rollup": "^4.9.5",
"tslib": "^2.6.2",
"tsx": "^3.12.7",
"twitter-api-sdk": "^1.2.1",
"twitter-api-v2": "^1.12.9",
"undici": "^5.22.1"
},
"devDependencies": {
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-typescript": "^11.1.6",
"@types/node": "^20.11.2",
"rollup-plugin-node-externals": "^6.1.2",
"typescript": "^4.9.3"
}
}
Solution
Fragly
Fragly•11mo ago
could you try using an up-to-date version of typescript?
Slashiy
SlashiyOP•11mo ago
Will try huh that worked weird well thank you!
Fragly
Fragly•11mo ago
No problem 🙂
Slashiy
SlashiyOP•11mo ago
Can't mark your answer as the fix so yeah
Slashiy
SlashiyOP•11mo ago
ty brody
Want results from more Discord servers?
Add your server