fix: replace webpack ESM outputModule with esbuild for dist/esm build - #88
Merged
HolimaX merged 1 commit intoSep 8, 2026
Conversation
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
merged commit Sep 8, 2026
6c5d04a
into
feature/Add-ESI-Transifex-OKTAforPCD1.3
1 of 6 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
experiments.outputModule: truethrewCannot read properties of null (reading '0')internally during the ESM compilation phase — a known webpack 5 bug in the experimental ESM output featureesmConfig/runWebpackpath inscripts/build-lib.jswith a newbuildEsm()function that uses esbuild, which has stable, production-ready ESM bundle outputesbuild ^0.20.0todevDependenciesso CI installs it before the build stepTest plan
npm run build:libcompletes without error (bothdist/cjs/index.jsanddist/esm/index.jsproduced)dist/esm/index.jscontains valid ES module syntax (export, norequire)dist/cjs/index.jsremains a valid CommonJS bundlebuild-nixpipeline (includingreact-scripts build) continues to passhttps://app.circleci.com/agents/gh/HolimaX/chat/8004bbb7-de7d-4059-bd4f-15600da69b0c