So you've upgraded to Node.js 20. It's a game-changer. But, you know, with great power comes great errors - like that pesky TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension.ts for src/App.ts. Yeah, it's a thing. This issue has been around for a while, and there's a whole discussion about it on TypeStrong/ts-node#2100. It all boils down to running .ts files with Worker - not exactly a match made in heaven. But, there's a fix. And it's pretty cool. You can use Vite and vite-node to make it work. Here's the lowdown: create a worker_wrapper.mjs file, and use vite-node to load and execute your TypeScript worker. Then, just create a parent.ts and child.ts file - easy peasy. This approach is a total winner because you can test thread separation during development, avoid those messy hacks with Node's experimental loaders, and ensure a seamless transition from development to build. It's all about innovation, strategy, and a bit of creativity. Check out the details here: https://lnkd.in/gZh3pQ9V #Nodejs #TypeScript #WorkerThreads #Innovation #Strategy #Development
Fixing TypeError with Node.js 20 and TypeScript
More Relevant Posts
-
How healthy are your APIs? Building a complex system is great, but knowing when it’s failing is better. For today's project, I built a Health Check Service in TypeScript to monitor API uptime and performance. It’s a lightweight CLI tool that pings a set of endpoints, measures latency, and provides a color-coded status report. What it does: - Parallel Pinging: Hits multiple APIs simultaneously. - Latency Tracking: Measures response times in milliseconds (critical for catching "slow-failures"). - Visual Feedback: Uses color-coded indicators (Green/Yellow/Red) based on performance thresholds. - Detailed Logging: Captures status codes and ISO timestamps for every request. The Tech Stack: - TypeScript (for that sweet type safety) - Node.js - Axios for handling HTTP requests One interesting thing I noticed while testing: even "public" APIs vary wildly in latency depending on the time of day. It’s a good reminder that your frontend is only as fast as the slowest service it depends on! GitHub Repo: https://lnkd.in/d7NXeQVq #100DaysOfCode #TypeScript #NodeJS #WebDevelopment #Backend #BuildInPublic #APIMonitoring
To view or add a comment, sign in
-
-
Enough trend chasing. Let’s talk about how real systems break. In large React + Node.js codebases, most problems don’t come from “bad code”. They come from unclear decisions. A few patterns I’ve seen repeatedly: • React performance issues are rarely about memoization — they’re about state living in the wrong place • “Async bugs” in Node aren’t async at all — they’re missing ownership of side effects • APIs fail not because of scale, but because contracts weren’t explicit • Refactors hurt because modules were coupled by convenience, not intent At scale, these questions matter more than libraries: – What owns the state, and who’s allowed to mutate it? – Where does async start and where must it end? – What guarantees does this function actually provide? – If this fails at 2am, can someone reason about it quickly? High-level programming is not abstraction for abstraction’s sake. It’s about making constraints obvious and failure modes boring. Frameworks evolve. Mental models compound. If you’ve worked on systems that lasted more than a year, you know this already. What’s one design decision you now think about earlier than you used to? #ReactJS #NodeJS #BackendEngineering #FrontendArchitecture #SystemDesign #SoftwareEngineering
To view or add a comment, sign in
-
-
🚀 Node.js quietly changed how we write backend code One thing I’ve really liked in recent Node.js versions is how much less tooling you actually need now. A few examples from real work: Native fetch → no extra HTTP client just to make an API call Built-in test runner → no heavy testing framework for simple cases Better performance out of the box → faster startup, better memory handling Security flags → you can restrict file system or network access at runtime None of these are flashy features. But together, they make Node.js feel simpler, cleaner, and more production-ready than before. It’s a good reminder that progress in engineering isn’t always about new frameworks — sometimes it’s about removing things. If you’re still running older Node versions, upgrading is honestly worth it. Curious: 👉 What’s one Node.js feature you started using recently and can’t go back from? #NodeJS #BackendDevelopment #JavaScript #SoftwareEngineering #WebDevelopment
To view or add a comment, sign in
-
Spent the week porting some backend logic from Next.js API routes over to NestJS. Man, the mental context switch is real. Coming from Next, you’re used to the "if it’s in the folder, it’s a route" simplicity. In Nest, if you forget to register a provider in a module, the whole thing falls apart. It feels like a lot of boilerplate at first—decorators everywhere, classes for everything, and heavy dependency injection. It’s basically Angular for the backend. The hardest part isn't the syntax; it’s unlearning the "just import it" habit and forced into thinking about IoC containers and provider scopes. That said, once the architecture clicks, the guardrails are actually pretty nice for larger projects. You stop worrying about where logic lives because the framework makes the choice for you. Anyone else find the jump from Next to Nest a bit jarring, or did it just click for you right away? #webdev #typescript #nextjs #nestjs #backend
To view or add a comment, sign in
-
Under the hood curiosity Being a good developer is not about memorizing frameworks. It’s about understanding: - How memory works - How threads work - How event loop works - How OS interacts with your code Frameworks change. Fundamentals stay. That mindset leveled me up. #nodejs #softwareengineering #backend
To view or add a comment, sign in
-
It's about reclaiming the time we usually lose to "configuration hell." For years, we’ve accepted the "Node.js tax": - npm for packages - tsc for TypeScript - Babel for transpiling - Vite for bundling - Jest for testing Enter Bun. 🚀 Bun is a single, ultra-fast binary that replaces all of the above. It’s not just an alternative; it’s a workflow revolution. Why I’m watching Bun closely: ✅ Speed:bun install is up to 25x faster than npm. ✅ Simplicity: Native TypeScript & JSX support. No more .babelrc or tsconfig headaches. ✅ Performance: Startup times under 1ms. ✅ Modern: Built-in SQLite and standard Web APIs (fetch/Request) out of the box. Is it time to simplify your stack? I’d love to hear from anyone #WebDevelopment #JavaScript #BunJS #SoftwareEngineering #TypeScript
To view or add a comment, sign in
-
-
Express + TypeScript is good. NestJS is better. 🛡️ I recently refactored an Express backend to NestJS. The difference was night and day. With Express + TS, I spent hours configuring: ❌ tsconfig paths ❌ Manual dependency wiring ❌ Custom middleware for validation ❌ A bespoke folder structure that only I understood With NestJS, I got this out of the box: ✅ Decorators: @Get, @Post, @Body make routes incredibly readable. ✅ DTOs: Automatic validation using class-validator (literally a lifesaver). ✅ Guards & Interceptors: A clean way to handle Auth and Logging without cluttering business logic. ✅ Testability: The DI container makes unit testing services a breeze compared to mocking module imports in Express. It feels like moving from "assembling the car yourself" to "driving a luxury vehicle." You still have control, but the safety features and engine are world-class. If you're a TypeScript developer, you owe it to yourself to try NestJS. What's your go-to Node framework in 2026? #WebDev #Coding #NestJS #ExpressJS #TechStack
To view or add a comment, sign in
-
-
When I started working with Node.js, I made several mistakes that slowed me down ⚠️ Looking back, these are the most common ones I still see today: 1️⃣ Ignoring proper error handling Not handling errors properly can crash your application or make debugging painful. Always handle async errors and return meaningful responses. 2️⃣ Blocking the event loop Using heavy synchronous code in Node.js defeats its non-blocking nature. Understanding how the event loop works is critical for performance 🧵 3️⃣ Writing everything in one file As projects grow, poor structure becomes a real problem. Separating routes, controllers, and services makes code easier to maintain and scale 🧱 Node.js is powerful — but only when used the right way. Avoiding these basics early can save you a lot of trouble in real-world projects. #NodeJS #JavaScript #BackendDevelopment #WebDevelopment #MERNStack
To view or add a comment, sign in
-
I used async code in Node.js for a long time. It worked. But if I’m being honest… the why was fuzzy. So I decided to explain Node’s async model to myself, like I was five — no diagrams, no jargon, no “just trust the event loop.” Here’s the version that finally stuck 👇 Node.js is not a hard worker. It’s a really good coordinator. When a network call happens: Node hands the slow work to the operating system and says “let me know when you’re done” and immediately goes back to handling other things No waiting around. No blocking the line. When the OS finishes, it taps Node on the shoulder — and the event loop schedules the callback when the JS stack is free. The one-liner that burned this into my brain: “Node doesn’t wait for work to finish — it waits to be notified.” Once I saw it this way, async stopped feeling like magic and started feeling… obvious. Reminder to myself: If a concept doesn’t survive simplification, I don’t actually own it yet. This one finally does. #LearningInPublic #SoftwareEngineering #NodeJS #BackendEngineering #SystemDesign #AsyncProgramming #DeveloperJourney #BuildInPublic #ComputerScience
To view or add a comment, sign in
-
TypeScript 𝐃𝐢𝐬𝐚𝐩𝐩𝐞𝐚𝐫𝐬 at 𝗖𝗼𝗺𝗽𝗶𝗹𝗲 𝗧𝗶𝗺𝗲 TypeScript is incredible for defining the shape of your data and flagging mismatches while you write code. But here is the catch: 𝐓𝐲𝐩𝐞𝐒𝐜𝐫𝐢𝐩𝐭 𝐨𝐧𝐥𝐲 𝐫𝐮𝐧𝐬 𝐚𝐭 𝐜𝐨𝐦𝐩𝐢𝐥𝐞 𝐭𝐢𝐦𝐞. After your app builds, those types vanish, and what is left is just JavaScript This becomes a critical issue when your app interacts with APIs or receives user inputs. Since the types are already gone by the time that data arrives, TypeScript cannot check if the response actually matches your expectations 𝐑𝐮𝐧𝐭𝐢𝐦𝐞 𝐯𝐚𝐥𝐢𝐝𝐚𝐭𝐢𝐨𝐧 fills this gap. 𝐙𝐨𝐝 lets you define a schema - the expected shape of your data - and validate against it 𝐚𝐬 𝐝𝐚𝐭𝐚 𝐚𝐜𝐭𝐮𝐚𝐥𝐥𝐲 𝐚𝐫𝐫𝐢𝐯𝐞𝐬. If the response doesn't match the schema, you know immediately. 𝐇𝐨𝐰 𝐭𝐡𝐢𝐬 𝐚𝐩𝐩𝐥𝐢𝐞𝐬: In Ark, every API response passes through a Zod schema before the frontend touches it. If the backend sends data that doesn't match the expected shape, the app catches it at the boundary. If you have any questions, put them down below 👇 #arklearnings #frontend #typescript #reliability
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development