When tsc Compiled to ES3

· 1 min read · 97 Words · -Views -Comments

During a CD deployment our web bundle unexpectedly compiled to ES3, causing a blank screen in browsers.

Error screenshot

Root Cause

A shared business component library ignored the main project’s tsconfig target. Our internal build tool picks the first tsconfig it finds; the component library lacked a target, so TypeScript defaulted to ES3. Remember: TypeScript only transpiles syntax—it doesn’t polyfill.

Fix

Compile component libraries to JavaScript before publishing. This:

  1. Speeds up app builds (libraries are precompiled).
  2. Ensures libraries aren’t affected by the host project’s tsconfig.

Final Thoughts

Lesson learned—always set explicit targets or ship compiled artifacts for shared packages.

Authors
Developer, digital product enthusiast, tinkerer, sharer, open source lover