utensil
utensil10mo ago

ERR_UNKNOWN_FILE_EXTENSION

Trying to run a convex app via cargo and getting following error: $ cargo run -p local_backend --bin convex-local-backend
Error: Failed to run convex deploy
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /home/git/convex-backend/npm-packages/convex/src/cli/index.ts
at new NodeError (node:internal/errors:405:5)
at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:136:11)
at defaultGetFormat (node:internal/modules/esm/get_format:182:36)
at defaultLoad (node:internal/modules/esm/load:101:20)
at nextLoad (node:internal/modules/esm/hooks:864:28)
at load (/home/git/convex-backend/npm-packages/common/temp/node_modules/.pnpm/ts-node@10.9.1_vuqh3gt2zvtpvbtbczhekraj64/node_modules/ts-node/dist/child/child-loader.js:19:122)
Error: Failed to run convex deploy
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /home/git/convex-backend/npm-packages/convex/src/cli/index.ts
at new NodeError (node:internal/errors:405:5)
at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:136:11)
at defaultGetFormat (node:internal/modules/esm/get_format:182:36)
at defaultLoad (node:internal/modules/esm/load:101:20)
at nextLoad (node:internal/modules/esm/hooks:864:28)
at load (/home/git/convex-backend/npm-packages/common/temp/node_modules/.pnpm/ts-node@10.9.1_vuqh3gt2zvtpvbtbczhekraj64/node_modules/ts-node/dist/child/child-loader.js:19:122)
3 Replies
ballingt
ballingt10mo ago
@utensil this looks like a Node.js 20 error, currently you need to use Node.js 18 There are docs somewhere about this, you want to use the Node.js version specified here https://github.com/get-convex/convex-backend/blob/main/.nvmrc If you use nvm you can use "nvm use" to do this, or you can just manually install this Node.js version.
utensil
utensilOP10mo ago
my node is 18.20.2 installed directly no nvm trying now with 18.17.0 hmm, this fixes the problem perhaps someone should update the acceptable node versions in the package file
ballingt
ballingt10mo ago
Oh I didn't realize this was broken in later Node.js 18 releases too. This is a bug we'll fix, unfortunately there's nowhere to update because in the package.hson the allowed node versions are for installing the package — this version requirement us only for developing it from the repo

Did you find this page helpful?