full-stack-todo icon indicating copy to clipboard operation
full-stack-todo copied to clipboard

Full Stack Development Series Part 9: User Authentication and JWT Support in Angular

Open uaKorona opened this issue 1 year ago • 0 comments

Hello ) I couldn't sign up on https://thefullstack.engineer/ so have decided to post my comment here:

In Storybook 7.0 + the code from Part 9 become failed with next error:

R3InjectorError(Standalone[StorybookWrapperComponent])[UserService -> UserService -> HttpClient -> HttpClient]: 
  NullInjectorError: No provider for HttpClient!

The reason is there is no root ngModule anymore. Previously you were able to add ModuleWithProviders, likely the result of a 'Module.forRoot()'-style call, to your 'imports' array of the moduleMetadata definition. This is now discouraged. Instead, you should use the applicationConfig decorator to add your application-wide providers. These providers will be passed to the bootstrapApplication function.

More details https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#angular-application-providers-and-modulewithproviders

I have added to my feature-register.component.stories

 applicationConfig({
      providers: [importProvidersFrom(HttpClientTestingModule)],
    }),
``` and story has started running correctly 

uaKorona avatar Dec 17 '23 17:12 uaKorona