0

我正在尝试TranslateModule在我的 html(我自己的库)中使用,但是当我构建 Storybook(使用 Angular 和 webpack)时,我收到了这个错误:

Unhandled Promise rejection: Importing TranslateModule which does not have a ɵmod 即使当我点击TranslateModule我看到:

export declare class TranslateModule {
    /**
     * Use this method in your root module to provide the TranslateService
     */
    static forRoot(config?: TranslateModuleConfig): ModuleWithProviders<TranslateModule>;
    /**
     * Use this method in your other (non root) modules to import the directive/pipe
     */
    static forChild(config?: TranslateModuleConfig): ModuleWithProviders<TranslateModule>;
    static ɵmod: ɵngcc0.ɵɵNgModuleDefWithMeta<TranslateModule, [typeof ɵngcc1.TranslatePipe, typeof ɵngcc2.TranslateDirective], never, [typeof ɵngcc1.TranslatePipe, typeof ɵngcc2.TranslateDirective]>;
    static ɵinj: ɵngcc0.ɵɵInjectorDef<TranslateModule>;
}

//# sourceMappingURL=public_api.d.ts.map

所以我怀疑这是我的 webpack 配置以及与故事书集成的问题。有任何想法吗?

这些是我使用的版本:

   "@ngx-translate/core": "^11.0.1",
    "@angular/common": "~10.2.0",
    "@angular/compiler": "~10.2.0",
    "@angular/core": "~10.2.0",
    "@storybook/addon-a11y": "^6.1.17",
    "@storybook/addon-actions": "^6.1.17",
    "@storybook/addon-knobs": "^6.1.17",
    "@storybook/addon-links": "^6.1.17",
    "@storybook/addon-notes": "^5.3.21",
    "@storybook/addons": "^6.1.17",
    "@storybook/angular": "^6.1.17",
4

0 回答 0