btroncone / ngrx-store-localstorage

Simple syncing between @ngrx store and local storage

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Angular 14 deepmerge warning

yuchuan1 opened this issue · comments

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

Me too see this warnings and we want and update

Same here.

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

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

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?
commented

@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

commented

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?

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

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