btroncone / ngrx-store-localstorage

Simple syncing between @ngrx store and local storage
MIT License
613 stars 118 forks source link

Angular 14 deepmerge warning #229

Open yuchuan1 opened 2 years ago

yuchuan1 commented 2 years ago

Versions ngrx-store-localstorage 14.0.0 Angular 14.0.5

Warning: /Users/user/myproject/node_modules/ngrx-store-localstorage/fesm2020/ngrx-store-localstorage.mjs depends on 'deepmerge'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
kyrolus commented 2 years ago

Me too see this warnings and we want and update

haidar-h commented 2 years ago

Same here.

dmitrydutin commented 2 years ago

Similar problem with angular 14.2.0

Warning: ...\node_modules\ngrx-store-localstorage\fesm2020\ngrx-store-localstorage.mjs depends on 'deepmerge'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
sleez007 commented 2 years ago

Hi @BBlackwo, This problem is still open and I had a similar experience after installing the package. any help on this?

BBlackwo commented 2 years ago

There are two options to fix this:

  1. Disable the warning https://angular.io/guide/build#configuring-commonjs-dependencies
    • Straightforward. Anyone is free to raise a PR with that change.
  2. Move to another library which uses ESModules
    • More risky and will need a lot of testing
    • This library already moved from lodash to deepmerge in 2019 #126
    • Is there a better library than deepmerge that uses ESModules?
M-a-c-Carter commented 1 year ago

@BBlackwo we'll see there is talk about them adding esm, i'd love to see this move forward, this is kind of out of date with standards there are already 2 libs that added support that are named ts-deepmerge and deepmerge-ts lol

M-a-c-Carter commented 1 year ago

https://snyk.io/advisor/npm-package/ts-deepmerge has is healthier than the original, and the package size is reduced seems like a really good choice imo. Also this issue was reported back in angular 14 (we're now on angular 16) also this fix seems pretty prescribed and simple?

Neizan93 commented 1 year ago

You can use npm install ngrx-store-localstorage-es to fix the warning until is fixed on 'ngrx-store-localstorage'.

yigsvnsla commented 1 year ago

You can use npm install ngrx-store-localstorage-es to fix the warning until is fixed on 'ngrx-store-localstorage'.

Could you provide an example? I have problems being able to use the npm install ngrx-store-localstorage-es dependency