How to fix ERR_UNKNOWN_FILE_EXTENSION in

  Рет қаралды 3,748

TypeScript TV with Benny

TypeScript TV with Benny

Күн бұрын

Пікірлер: 26
@TypeScriptTV
@TypeScriptTV 10 ай бұрын
If you want to run "ts-node" in production with ESM, then use: "tsc --noEmit && node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only src/main.ts" (see github.com/TypeStrong/ts-node/issues/104#issuecomment-1941702624)
@humaitrix
@humaitrix 9 ай бұрын
Thank you Benny! Amazing video, not only sharing the solution but explaining why it's the best solution available at the moment! Tks a lot
@TypeScriptTV
@TypeScriptTV 9 ай бұрын
Thank you, Daniel! It's important for me to not only show the "how" but also explain the "why". I try to follow this principle in all my TypeScript tutorials. 😀
@k3rnel_err0r
@k3rnel_err0r 10 ай бұрын
This is easily the most underrated TS channel on KZbin. Thank you for your videos Benny.
@TypeScriptTV
@TypeScriptTV 10 ай бұрын
Thank you! I also think the same. 😅 Btw. I made an app for programmers: apps.apple.com/app/id659282498
@tonyg_nerd
@tonyg_nerd 2 ай бұрын
😮 Mouth fell open watching this. There's no way that today's copy/paste developers are going to create quality software with scenarios like this. I've been doing this for decades, have been following advice for all of these various tools, to solve these problems, and had no clue about the details that you provided here. OMG - Thank you! I need to change my approach to this tooling ... maybe go back to BASIC. 😂
@HemantKumar-yk2jk
@HemantKumar-yk2jk 2 ай бұрын
Excellent videos .. one of the best videos in TS
@TypeScriptTV
@TypeScriptTV 2 ай бұрын
Thank you! It's also reported that using "vite-node src/main.ts" is a viable option.
@MonsterSmart
@MonsterSmart 3 ай бұрын
Great video. That was the last thing I couldn't figure out in my ts node setup
@leonardogonzalezrodriguez2290
@leonardogonzalezrodriguez2290 9 ай бұрын
Thank you so much for your explanation, it helped me a lot
@mahdiahmadi504
@mahdiahmadi504 Ай бұрын
Thanks for your comprehensive video! I was struggling with those errors for 5 hours before finding a solution. I tried tsx and noticed that while it’s fast, it lacks type checking. Finally, I ended up using the command: nodemon --exec node --loader ts-node/esm src/index.ts This setup does perform type checking. For example, if you write let x: string = 20, nodemon crashes the app with an error. However, I noticed that, like node with ts-node/esm, it doesn’t provide a stack trace for errors. Do you have any suggestion?
@TypeScriptTV
@TypeScriptTV Ай бұрын
Hi @mahdiahmadi504, to get stack traces, you can use tsimp (14:58) or run tsc --noEmit before executing ts-node-esm, as shown here: typescript.tv/hands-on/write-a-simple-typescript-script-with-esm/#fixing-err_unknown_file_extension
@evlbon
@evlbon 3 ай бұрын
Its so stupid that ts-node --esm is not working with node v20+
@HemantKumar-yk2jk
@HemantKumar-yk2jk 2 ай бұрын
can we run this main.ts directly in the aws lambda or do we need to convert to js ?? i am not sure how can we use this for aws lambda ??
@TypeScriptTV
@TypeScriptTV 2 ай бұрын
To use your TypeScript code with AWS Lambda, you need to convert it to JavaScript: docs.aws.amazon.com/lambda/latest/dg/lambda-typescript.html
@rama3018
@rama3018 8 күн бұрын
haha, i work with separated workspace and this save me hahaha
@TypeScriptTV
@TypeScriptTV 4 күн бұрын
Glad to hear this is helpful to you! By including a .nvmrc file in your repository, you can also configure nvm to automatically switch Node.js versions when necessary.
@seeyou7989
@seeyou7989 10 ай бұрын
Thanks but what if i have to use nodemon
@TypeScriptTV
@TypeScriptTV 10 ай бұрын
When using nodemon, you can create a "nodemon.json" file in your repository and use the commands in the "exec" section.
@evlbon
@evlbon 3 ай бұрын
can be nodemon --exec node --loader ts-node/esm index.ts
@sayandedotcom
@sayandedotcom 10 ай бұрын
how to do it with nodemon "node --loader ts-node/esm && nodemon ./index.ts"
@TypeScriptTV
@TypeScriptTV 5 ай бұрын
Will you get type checking when doing this?
@evlbon
@evlbon 3 ай бұрын
I think u mean smt like this nodemon --exec node --loader ts-node/esm index.ts
Fix Every TypeScript Error with This Tool!
16:49
TypeScript TV with Benny
Рет қаралды 1,9 М.
Jaidarman TOP / Жоғары лига-2023 / Жекпе-жек 1-ТУР / 1-топ
1:30:54
#behindthescenes @CrissaJackson
0:11
Happy Kelli
Рет қаралды 27 МЛН
Why use Type and not Interface in TypeScript
14:12
ByteGrad
Рет қаралды 219 М.
How To Use TypeScript With Express & Node
17:05
Colt Steele
Рет қаралды 75 М.
I tried 8 different Postgres ORMs
9:46
Beyond Fireship
Рет қаралды 442 М.
The End of ts-node? Here’s What You Need to Know.
20:57
TypeScript TV with Benny
Рет қаралды 532
Express JS with TypeScript - Setup, Examples, Testing
1:20:13
Anson the Developer
Рет қаралды 46 М.
TypeScript, Node, esbuild, Commander... Let's build a CLI!
1:10:21
Matt Pocock
Рет қаралды 38 М.
How Did I Not Know This TypeScript Trick Earlier??!
9:11
Josh tried coding
Рет қаралды 218 М.
How to handle Node.js errors like a Pro?
12:44
Software Developer Diaries
Рет қаралды 36 М.
Jaidarman TOP / Жоғары лига-2023 / Жекпе-жек 1-ТУР / 1-топ
1:30:54