Skip to content

[Bug]: Getting Error NG0201: No provider found for HttpClient #32420

@ankurdeal

Description

@ankurdeal

Describe the bug

I'm using angular 20.2.4 and storybook 9.1.4. I have removed appModule and generated app.config.ts file while upgrading. I have one component which is not a standalone component and use httpclient service. When I'll use this compeonent in storybook stories I'm getting error like No provider found for HTTPClient. I have tried with different approach but it's still showing me error. What is the possible way I can do that will resolve my above error.

Image

Reproduction link

Getting error with stackblitz generation will add soon

Reproduction steps

No response

System

Storybook Environment Info:
(node:9948) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not escaped, only concatenated.
(Use `node --trace-deprecation ...` to show where the warning was created)

  System:
    OS: Windows 11 10.0.22631
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
  Binaries:
    Node: 24.7.0 - C:\Program Files\nodejs\node.EXE
    npm: 11.5.1 - C:\Program Files\nodejs\npm.CMD <----- active
  Browsers:
    Edge: Chromium (139.0.3405.125)
  npmPackages:
    @storybook/addon-docs: 9.1.4 => 9.1.4
    @storybook/addon-links: ^9.1.4 => 9.1.4
    @storybook/angular: ^9.1.4 => 9.1.4
    chromatic: ^6.8.0 => 6.24.1
    storybook: ^9.1.4 => 9.1.4

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions