7 months ago
Hi, I was running my Typescript Discord bot with the same configuration since Feb 2024 with no issues. My bot currently works fine when I run it locally via yarn start
. I recently redeployed and am now hitting the below error after running yarn start
and such my deployments crash.
TypeError [ERRUNKNOWNFILEEXTENSION]: Unknown file extension ".ts" for /app/src/Bot.ts at new NodeError (node:internal/errors:405:5) at Object.getFileProtocolModuleFormat as file: at defaultGetFormat (node:internal/modules/esm/getformat:182:36)
at defaultLoad (node:internal/modules/esm/load:101:20)
at nextLoad (node:internal/modules/esm/hooks:864:28)
at load (/app/nodemodules/ts-node/dist/child/child-loader.js:19:122) at nextLoad (node:internal/modules/esm/hooks:864:28) at Hooks.load (node:internal/modules/esm/hooks:447:26) at MessagePort.handleMessage (node:internal/modules/esm/worker:196:24) at nodejs.internal.kHybridDispatch { code: 'ERRUNKNOWNFILEEXTENSION'
}
error Command failed with exit code 1.
ⓘ Deployment information is only viewable by project members and Railway employees.
1 Replies
7 months ago
Instead of ts-node
I would recommend transpiling with tsc
in a build script and then running the resulting js file with node in your start script.