TranslocoCurrenyPipe NullInjectorError #29085
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Since you are using an NgModule, I will assume your project does not bootstrap a standalone component. Storybook now bootstraps a standalone component, so there is not really a root NgModule. Before standalone components, Angular assumed you would use the root module correctly and only import your root providers in the root NgModule, but standalone apps are more strict about enforcing that. I am going to assume you already considered this or are doing something that this doesn't matter, based on the error that you showed. Without more knowledge of your project, I can only make assumptions, but I will assume I don't think the library expects pipes to be used outside of a template, since pipes are a feature for templates. If you aren't initializing the pipe in a place that is guaranteed to call Could you instead inject I threw together a Stackblitz, from various snippets in their documentation. Since I don't use Transloco, I can't guarantee they are right, unless I do more testing. https://stackblitz.com/edit/github-yveuhs |
Beta Was this translation helpful? Give feedback.
Since you are using an NgModule, I will assume your project does not bootstrap a standalone component. Storybook now bootstraps a standalone component, so there is not really a root NgModule. Before standalone components, Angular assumed you would use the root module correctly and only import your root providers in the root NgModule, but standalone apps are more strict about enforcing that. I am going to assume you already considered this or are doing something that this doesn't matter, based on the error that you showed.
Without more knowledge of your project, I can only make assumptions, but I will assume
GoogleMapsService
has@Injectable({ providedIn: 'root' })
. I don't remember when t…