ngrx-store-localstorage icon indicating copy to clipboard operation
ngrx-store-localstorage copied to clipboard

Angular 14 deepmerge warning

Open yuchuan1 opened this issue 3 years ago • 9 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

yuchuan1 avatar Jul 07 '22 01:07 yuchuan1

Me too see this warnings and we want and update

kyrolus avatar Jul 13 '22 21:07 kyrolus

Same here.

haidar-h avatar Jul 28 '22 09:07 haidar-h

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

dmitrydutin avatar Sep 04 '22 13:09 dmitrydutin

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

sleez007 avatar Oct 13 '22 04:10 sleez007

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?

BBlackwo avatar Oct 13 '22 05:10 BBlackwo

@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 avatar Jun 03 '23 01:06 M-a-c-Carter

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?

M-a-c-Carter avatar Jun 09 '23 15:06 M-a-c-Carter

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

Neizan93 avatar Aug 07 '23 07:08 Neizan93

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

yigsvnsla avatar Sep 21 '23 14:09 yigsvnsla