【发布时间】:2021-03-09 14:51:41
【问题描述】:
使用 ng serve / nx serve 时,我的 Angular10 应用程序运行良好。 NGRX 商店和功能商店按预期工作。
但是,当我尝试从项目中的任何 Lib 运行 Storybook 时,我会遇到错误。 为什么是这样?我该如何解决?到目前为止我还没有找到解决方案。
这是错误的一部分:
StaticInjectorError(Platform: core)[InjectionToken @ngrx/store Check if Action types are unique -> InjectionToken @ngrx/store Internal Runtime Checks]:
NullInjectorError: No provider for InjectionToken @ngrx/store Internal Runtime Checks!
有人知道解决办法吗?谢谢。
【问题讨论】:
-
确保在你的模块中导入 StoreModule。
-
@TitusSutioFanpula 是的,你是对的!问题是我需要导入 Store 和 Effects 模块 - 即使故事的功能不使用 ngrx 商店。我没有意识到这是必需的。
标签: angular testing ngrx storybook angular-storybook