Skip to content

feat(exe)!: require Node >=25.7 and default format to esm#798

Merged
sxzz merged 3 commits intomainfrom
rei/exe-node25-7-default-esm
Mar 4, 2026
Merged

feat(exe)!: require Node >=25.7 and default format to esm#798
sxzz merged 3 commits intomainfrom
rei/exe-node25-7-default-esm

Conversation

@sxzz
Copy link
Member

@sxzz sxzz commented Mar 4, 2026

Summary

Raise the minimum Node.js version for exe from >=25.5.0 to >=25.7.0, and always default to ESM format (removing the CJS fallback for older versions).

Motivation

Node.js SEA (Single Executable Applications) introduced an incompatible format change between v25.6.x and v25.7.0. Executables built with one side of this boundary cannot run on the other:

Build \ Target 25.5.0 25.6.0 25.6.1 25.7.0 25.8.0
25.5.0 ❌ assert(134) ❌ assert(134)
25.6.1 ❌ assert(134) ❌ assert(134)
25.7.0 ❌ segfault(139) ❌ segfault(139) ❌ segfault(139)
25.8.0 ❌ segfault(139) ❌ segfault(139) ❌ segfault(139)

The cross-boundary failure is caused by a SeaDeserializer::Read() assertion at node_sea.cc:171: format_value <= static_cast<uint8_t>(ModuleFormat::kModule).

Since @tsdown/exe already requires >=25.7.0 for downloading Node binaries (SEA_VERSION_RANGE), aligning the build-time check avoids a confusing gap where tsdown --exe would appear to succeed on 25.5/25.6 but produce binaries incompatible with the downloaded target.

With 25.7.0 as the minimum, ESM SEA is always supported, so the conditional CJS fallback is no longer needed.

Changes

  • src/features/exe.ts: validateSea() now checks >=25.7.0
  • src/config/options.ts: Remove conditional CJS default when exe is enabled (letconst, always esm)
  • src/config/types.ts: Update JSDoc for format and exe options
  • docs/options/exe.md, docs/reference/cli.md: Update requirements and behavior
  • docs/zh-CN/options/exe.md, docs/zh-CN/reference/cli.md: Chinese docs sync

@netlify
Copy link

netlify bot commented Mar 4, 2026

Deploy Preview for tsdown-main ready!

Name Link
🔨 Latest commit 10d60a2
🔍 Latest deploy log https://app.netlify.com/projects/tsdown-main/deploys/69a8553f3494da00083e2813
😎 Deploy Preview https://deploy-preview-798--tsdown-main.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 4, 2026

Open in StackBlitz

tsdown

pnpm add https://pkg.pr.new/tsdown@798 -D
npm i https://pkg.pr.new/tsdown@798 -D
yarn add https://pkg.pr.new/tsdown@798.tgz -D

create-tsdown

pnpm add https://pkg.pr.new/create-tsdown@798 -D
npm i https://pkg.pr.new/create-tsdown@798 -D
yarn add https://pkg.pr.new/create-tsdown@798.tgz -D

@tsdown/css

pnpm add https://pkg.pr.new/@tsdown/css@798 -D
npm i https://pkg.pr.new/@tsdown/css@798 -D
yarn add https://pkg.pr.new/@tsdown/css@798.tgz -D

@tsdown/exe

pnpm add https://pkg.pr.new/@tsdown/exe@798 -D
npm i https://pkg.pr.new/@tsdown/exe@798 -D
yarn add https://pkg.pr.new/@tsdown/exe@798.tgz -D

tsdown-migrate

pnpm add https://pkg.pr.new/tsdown-migrate@798 -D
npm i https://pkg.pr.new/tsdown-migrate@798 -D
yarn add https://pkg.pr.new/tsdown-migrate@798.tgz -D

commit: 10d60a2

@sxzz sxzz changed the title feat(exe): require Node >=25.7 and default format to esm feat(exe)!: require Node >=25.7 and default format to esm Mar 4, 2026
@sxzz sxzz merged commit 0173c6e into main Mar 4, 2026
15 checks passed
@sxzz sxzz deleted the rei/exe-node25-7-default-esm branch March 4, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants