ng-turkey / ngxs-reset-plugin

Reset plugin for NGXS: Effortlessly clears, resets, or overwrites NGXS states respecting the state tree.
https://stackblitz.com/edit/ngxs-pizza
MIT License
108 stars 8 forks source link

No matching export in "node_modules/@ngxs/store/fesm2022/ngxs-store.mjs" for import "getStoreMetadata" after migrating to NGXS 18.0.0 #91

Open vinayaren31 opened 5 months ago

vinayaren31 commented 5 months ago

Describe the bug After migrating from NGXS version 3.8.2 to 18.0.0, I encountered the following error: No matching export in "node_modules/@ngxs/store/fesm2022/ngxs-store.mjs" for import "getStoreMetadata" node_modules/ngxs-reset-plugin/fesm2020/ngxs-reset-plugin.mjs:4:53: 4 │ import { ofActionSuccessful, InitState, UpdateState, getStoreMetadata, getValue, setValue, getActionTypeFromInstance, NGXS_PLUGINS } from '@ngxs/store';

To Reproduce Steps to reproduce the behavior:

  1. Update the NGXS package from version 3.8.2 to 18.0.0 in package.json.
  2. Run the application.
  3. Observe the error. Screenshot 2024-06-21 at 1 39 00 PM

Expected behavior The application should run without errors after the migration.

Environment NGXS Version: 18.0.0 Angular Version: 18.0.3 Node.js Version: 20.14.5 Browser: Chrome

pham93 commented 5 months ago

I'm not sure if this project is still being maintained, last update was for angular version 14. as of NGXS version 18, getStoreMetaData has moved to @ngxs/store/internals https://github.com/ngxs/store/pull/2062

I was able to update the library to version 18. Though, I'm not sure if it is the right move to import functionalities from @ngxs/store/internals, but at least this will have it support v.18

pham93 commented 5 months ago

I have it ran and tested on angular v.18. Still trying to figure out how I can contact the maintainer to create a PR.

mobilerast commented 5 months ago

hello @pham93 feel free to add me as a reviewer to your PR. I can help with that.

lapisanlangit commented 5 months ago

any solution? i have error too in angular 18.0.0

armanozak commented 5 months ago

@vinayaren31, @lapisanlangit ngxs-reset-plugin v4 is released yesterday. Could you please try it and let us know if the issue is resolved?

@pham93 Thank you for your amazing contribution. Much appreciated. 🙏

seiyria commented 3 months ago

Would appreciate a followup to this: not everyone uses standalone mode - keeping the module would be nice for those that don't.