Skip to content

[P3] Update tsconfig target from ES2017 to ES2022 for Node 24 compatibility #680

Description

@itsmiso-ai

Problem: The tsconfig.json sets target: "ES2017", which causes TypeScript to downlevel modern JavaScript syntax (async iteration, optional chaining, nullish coalescing) to ES2017-compatible output. Since the runtime environment is Node.js 24 (per package.json "node": "=24" and the Dockerfile base image node:24-bookworm-slim), this adds unnecessary transpilation overhead and produces larger, slower code. Node 24 natively supports all ES2022+ features.

Evidence:

// tsconfig.json
{
  "compilerOptions": {
    "target": "ES2017",
    // ...
  }
}
# Dockerfile
FROM node:24-bookworm-slim AS base
// package.json
"engines": { "node": "=24" }

Node 24 supports:

  • ES2022 features natively (class fields, static initialization blocks, .at(), regex match indices)
  • ESNext async iteration, top-level await, and Array.fromAsync (ES2024+)
  • The Next.js bundler module resolution already handles the rest

Acceptance:

  • tsconfig.json target is changed from "ES2017" to "ES2022" (or "ESNext")
  • npm run typecheck passes with no new errors
  • npm run build succeeds and produces a working Next.js standalone build
  • CI typecheck and build steps pass
  • Optional: verify the output .next/ bundle size is smaller than before

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions