Angular build floods with ESM warnings

Open
#2,599 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Quiet
Tech stack
angular, typescript
Domain
frontend

Research direction

Reproduce an Angular v20 build using JSON Forms 3.8.0 and inspect the listed entry points in node_modules/@jsonforms/angular, @jsonforms/core, and @jsonforms/angular-material. Trace the lodash, ajv, ajv-formats, and dayjs imports, then verify that the build no longer emits the reported ESM warnings and avoids unnecessary package inclusion.

Written by the indexing model from the issue text.

Description

Describe the bug

Not sure if should report as a bug but from my point of view it's an issue that should be addressed.

At the moment when building the angular project (v20) I'm being flooded with "X package is not ESM" coming from this package.
We use lodash-es and this also means we will have two times the lodash package.
lodash is not the only culprit: "avj" and "dayjs". We don't use dayjs not sure why this is being included on the bundle.

Looking forward to see how we can proceed with fixing this, I could help on some parts.


Imports flagged

[WARNING] Module 'lodash/cloneDeep' used by 'node_modules/@jsonforms/angular/lib/fesm2022/jsonforms-angular.mjs' is not ESM
[WARNING] Module 'lodash/merge' used by 'node_modules/@jsonforms/angular/lib/fesm2022/jsonforms-angular.mjs' is not ESM
[WARNING] Module 'lodash/maxBy' used by 'node_modules/@jsonforms/angular/lib/fesm2022/jsonforms-angular.mjs' is not ESM
[WARNING] Module 'lodash/isEqual' used by 'node_modules/@jsonforms/angular/lib/fesm2022/jsonforms-angular.mjs' is not ESM
[WARNING] Module 'lodash/get' used by 'node_modules/@jsonforms/angular/lib/fesm2022/jsonforms-angular.mjs' is not ESM
[WARNING] Module 'lodash/isEmpty' used by 'node_modules/@jsonforms/core/lib/jsonforms-core.esm.js' is not ESM
[WARNING] Module 'lodash/startCase' used by 'node_modules/@jsonforms/core/lib/jsonforms-core.esm.js' is not ESM
[WARNING] Module 'lodash/keys' used by 'node_modules/@jsonforms/core/lib/jsonforms-core.esm.js' is not ESM
[WARNING] Module 'lodash/range' used by 'node_modules/@jsonforms/core/lib/jsonforms-core.esm.js' is not ESM
[WARNING] Module 'lodash/has' used by 'node_modules/@jsonforms/core/lib/jsonforms-core.esm.js' is not ESM
[WARNING] Module 'lodash/find' used by 'node_modules/@jsonforms/core/lib/jsonforms-core.esm.js' is not ESM
[WARNING] Module 'lodash/includes' used by 'node_modules/@jsonforms/core/lib/jsonforms-core.esm.js' is not ESM
[WARNING] Module 'ajv' used by 'node_modules/@jsonforms/core/lib/jsonforms-core.esm.js' is not ESM
[WARNING] Module 'ajv-formats' used by 'node_modules/@jsonforms/core/lib/jsonforms-core.esm.js' is not ESM
[WARNING] Module 'lodash/filter' used by 'node_modules/@jsonforms/core/lib/jsonforms-core.esm.js' is not ESM
[WARNING] Module 'lodash/fp/set' used by 'node_modules/@jsonforms/core/lib/jsonforms-core.esm.js' is not ESM
[WARNING] Module 'lodash/fp/unset' used by 'node_modules/@jsonforms/core/lib/jsonforms-core.esm.js' is not ESM
[WARNING] Module 'lodash/isFunction' used by 'node_modules/@jsonforms/core/lib/jsonforms-core.esm.js' is not ESM
[WARNING] Module 'lodash/remove' used by 'node_modules/@jsonforms/core/lib/jsonforms-core.esm.js' is not ESM
[WARNING] Module 'lodash/endsWith' used by 'node_modules/@jsonforms/core/lib/jsonforms-core.esm.js' is not ESM
[WARNING] Module 'lodash/last' used by 'node_modules/@jsonforms/core/lib/jsonforms-core.esm.js' is not ESM
[WARNING] Module 'lodash/reduce' used by 'node_modules/@jsonforms/core/lib/jsonforms-core.esm.js' is not ESM
[WARNING] Module 'lodash/toPairs' used by 'node_modules/@jsonforms/core/lib/jsonforms-core.esm.js' is not ESM
[WARNING] Module 'lodash/isUndefined' used by 'node_modules/@jsonforms/core/lib/jsonforms-core.esm.js' is not ESM
[WARNING] Module 'dayjs' used by 'node_modules/@jsonforms/angular-material/lib/fesm2022/jsonforms-angular-material.mjs' is not ESM
[WARNING] Module 'dayjs/plugin/customParseFormat' used by 'node_modules/@jsonforms/angular-material/lib/fesm2022/jsonforms-angular-material.mjs' is not ESM
[WARNING] Module 'lodash/some' used by 'node_modules/@jsonforms/angular-material/lib/fesm2022/jsonforms-angular-material.mjs' is not ESM

Expected behavior

Not have ESM build warnings, better manage which packages are being included

Steps to reproduce the issue
  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error
Screenshots
Image Image Image
Which Version of JSON Forms are you using?

3.8.0

Package

Angular Bindings

Additional context

No response

Dominant language
TypeScript
Stars
2.7k
Forks
423
Avg merge
17d 8h
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from eclipsesource/jsonforms

All issues in eclipsesource/jsonforms

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.