Dev Tools · 2h ago
TypeScript 5.7 nodenext Breaks Legacy Express Apps: How to Fix
TypeScript 5.7 tightens nodenext module resolution to match Node.js's ESM/CommonJS behavior, breaking legacy Express apps that previously compiled. Three common patterns—require() calls to ESM-only packages, missing file extensions, and JSON imports without assertions—now fail at compile time. Developers must add file extensions, switch to dynamic import(), or configure resolveJsonModule to restore builds.
Meridian48 take
The fix is straightforward, but the upgrade pain highlights how many TypeScript projects rely on compiler leniency rather than spec compliance.
Read the full reporting
How TypeScript 5.7's `--module nodenext` Changes Are Breaking Legacy Express Apps (and How to Fix Them) →
DEV Community
typescript-5.7module-resolution