fair-rose
fair-rose•2y ago

TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts"

how do I get rid of that error, using the Get started template with TS
8 Replies
fair-rose
fair-roseOP•2y ago
GitHub
ERR_UNKNOWN_FILE_EXTENSION on Node v20.0.0 · Issue #1966 · apify/cr...
ts-node-esm is broken in node v20+ (tested on v20.4), we should move to node --no-warnings=ExperimentalWarning --loader ts-node/esm src/main.ts before it's fixed. > ts-node-esm -T src/main.t...
wee-brown
wee-brown•2y ago
I think I am experiencing this bug as well and thus can't start the crawlee project 🫤. I have updated to the latest node and tsc-node-esm so far I can see. Do you have any workarounds to this? @Lukas Krivka Do you have any idea about this issue? 😊
genetic-orange
genetic-orange•2y ago
yeah tsc has been a pain in the ass with .ts files, either use tsx or simply .js files in the meanwhile tsc needs to fix their esm bundling
wee-brown
wee-brown•2y ago
@AltairSama2 tsx works locally but is not supported on apify cloud so my customers cant start the actor 😦
genetic-orange
genetic-orange•2y ago
then the workaround is to use .js extension while using typescriot inside it atleast according to tsx's github last I checked
flat-fuchsia
flat-fuchsia•2y ago
@Casper it IS supported on the platfrom - I started to experience this too recently, and using tsx instaed of ts-node fixed it for me (on the platform).
wee-brown
wee-brown•2y ago
Thanks for the confirmation. I finally resolved the issues 🙂 However I have also updated my Readme file but my actor on the apify store has not been updated with the changes to my readme file. How can I figure out why this has failed? Also I have fixed a bunch of bugs that put the actor into maintenance mode, but when I remove it from maintenance mode, Apify automated testing system keeps setting it back and reference a previous test as the reason.
flat-fuchsia
flat-fuchsia•2y ago
@Zuzka (Apify)

Did you find this page helpful?