ngrx / platform

Reactive State for Angular
https://ngrx.io
Other
8.01k stars 1.97k forks source link

No matching export in "node_modules/@ngrx/component-store/fesm2022/ngrx-component-store.mjs" for import "tapResponse" #4414

Closed dragonflypl closed 3 months ago

dragonflypl commented 3 months ago

Which @ngrx/* package(s) are the source of the bug?

component-store

Minimal reproduction of the bug/regression with instructions

After installing latest 18 version of component store into Angular 18 project after migration, I get this compilation error:

No matching export in "node_modules/@ngrx/component-store/fesm2022/ngrx-component-store.mjs" for import "tapResponse"

when importing tapResponse

import { tapResponse } from '@ngrx/component-store';

Expected behavior

Import should work

Versions of NgRx, Angular, Node, affected browser(s) and operating system(s)

Angular@18 Node@20

Other information

No response

I would be willing to submit a PR to fix this issue

rainerhahnekamp commented 3 months ago

@dragonflypl tapResponse has been moved to '@ngrx/operators' as of version 18. The migration script should have updated your import statement. You can do it manually by replacing it with

import { tapResponse } from '@ngrx/component-store';

It would be great if you could let us know the imports of that file. Maybe an unknown issue with the migration.

markostanimirovic commented 3 months ago

Thanks @rainerhahnekamp!

@dragonflypl to run the migration schematic you should use ng update instead of updating dependencies manually.