Skip to content

fix: replace webpack ESM outputModule with esbuild for dist/esm build - #88

Merged
HolimaX merged 1 commit into
feature/Add-ESI-Transifex-OKTAforPCD1.3from
chunk/fix-esm-build-use-esbuild
Sep 8, 2026
Merged

HolimaX merged 1 commit into
feature/Add-ESI-Transifex-OKTAforPCD1.3from
chunk/fix-esm-build-use-esbuild

Conversation

@circleci-app

@circleci-app circleci-app Bot commented Sep 8, 2026

Copy link
Copy Markdown

Summary

  • Job 418 failed because webpack 5's experiments.outputModule: true threw Cannot read properties of null (reading '0') internally during the ESM compilation phase — a known webpack 5 bug in the experimental ESM output feature
  • The CJS webpack build completed successfully (2002ms); only the ESM build was broken
  • Replaced the broken esmConfig / runWebpack path in scripts/build-lib.js with a new buildEsm() function that uses esbuild, which has stable, production-ready ESM bundle output
  • Added esbuild ^0.20.0 to devDependencies so CI installs it before the build step
  • The CJS build continues to use webpack + babel-loader unchanged

Test plan

  • CI build step npm run build:lib completes without error (both dist/cjs/index.js and dist/esm/index.js produced)
  • dist/esm/index.js contains valid ES module syntax (export, no require)
  • dist/cjs/index.js remains a valid CommonJS bundle
  • Full build-nix pipeline (including react-scripts build) continues to pass

https://app.circleci.com/agents/gh/HolimaX/chat/8004bbb7-de7d-4059-bd4f-15600da69b0c

webpack 5's experiments.outputModule triggered "Cannot read properties of
null (reading '0')" internally during the ESM compilation phase (job 418).
The CJS build was unaffected.

Replace the broken esmConfig webpack path in scripts/build-lib.js with a
buildEsm() function that uses esbuild, which has stable, well-tested ESM
bundle output. Add esbuild ^0.20.0 to devDependencies so CI installs it.

The CJS build continues to use webpack unchanged.

AI-Generated: true
@HolimaX
HolimaX merged commit 6c5d04a into feature/Add-ESI-Transifex-OKTAforPCD1.3 Sep 8, 2026
1 of 6 checks passed
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.

1 participant