Skip to content

fix(schematics): load ng-add when the package is already installed - #362

Merged
xidedix merged 1 commit into
v5.7from
fix/schematics-commonjs-scope
Dec 1, 2026
Merged

xidedix merged 1 commit into
v5.7from
fix/schematics-commonjs-scope

Conversation

@xidedix

@xidedix xidedix commented Dec 1, 2026 •

Copy link
Copy Markdown
Member
  • Since 5.7.0 the packages are "type": "module", but the compiled schematics are CommonJS.
  • ng add of an installed package and ng g @coreui/angular:ng-add failed with "exports is not defined in ES module scope".
  • A first ng add into a project without the package still worked.
  • schematics/package.json sets the CommonJS scope.
  • postbuild copies it and runs the built factory, so a broken schematic fails the build.

Since 5.7.0 the packages are "type": "module" and the compiled schematics
CommonJS, so ng add of an installed package and ng g <pkg>:ng-add threw
"exports is not defined in ES module scope". schematics/package.json sets
the CommonJS scope; postbuild copies it and runs the built factory module,
so the build fails when it stops loading.
@xidedix
xidedix merged commit 52ddc44 into v5.7 Dec 1, 2026
9 checks passed
@xidedix
xidedix deleted the fix/schematics-commonjs-scope branch December 1, 2026 23:43
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