'The pipe 'ngrxPush' could not be found

I am new to NgRx and I have being learning for the past week.

So, I was trying to check the Push Pipe and let directive.

According to NgRx Documentation the installation of this guy would be using the following command:

yarn add github:ngrx/component-builds.git

My code is the following:

<ons-list-item expandable *ngFor="let user of users$ | ngrxPush">
 <!-- code here -->
</ons-list-item>

Well after that I tried to find the module that I need to import to have this pipe. To have the async pipe i just need to import the CommonModule.

Any Idea what should I import to have this working? Looks like the documentation is not too clear in this part.



Solution 1:[1]

You have to import the ReactiveComponentModule.

import { ReactiveComponentModule } from '@ngrx/component';

docs here

Solution 2:[2]

I was facing a similar issue for my unit test.

The pipe 'ngrxPush' could not be found!

The issue was persisting even though I've imported the correct module i.e. ReactiveComponentModule which contains the ngrxPush in spec.ts file.

In my case, the error got resolved when I fixed the mockStore's config(added the missing initialState attribute).

  providers: [
    provideMockStore(
      {
        initialState: {
          changePassword: false
        }
      })
  ]

I believe the stack trace provided by Angular for unit test is misleading.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Lys
Solution 2 Rajat Badjatya