~/node_modules/ng-http-loader/ng-http-loader.d.ts 中的指令 AbstractLoaderDirective 错误没有选择器,请添加

Error in Directive AbstractLoaderDirective in ~/node_modules/ng-http-loader/ng-http-loader.d.ts has no selector, please add it

我正在尝试使用 'ng-http-loader' 为 angular api 调用实现微调器。代码工作正常,但是在构建我的应用程序时 'Yarn build' 它失败并出现以下错误:

ERROR in Directive AbstractLoaderDirective in E:/~/node_modules/ng-http-loader/ng-http-loader.d.ts没有选择器,请添加! 无法确定 E:/~/node_modules/ng-http-loader/ng-http-loader.d.ts 中 class AbstractLoaderDirective 的模块!将 AbstractLoaderDirective 添加到 NgModule 以修复它。

有人遇到过这个错误吗?

实施遵循以下提供的步骤:https://www.npmjs.com/package/ng-http-loader

production.module.ts:

import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { RouterModule } from '@angular/router';

import { OnesortParcelsSharedModule } from 'app/shared/shared.module';
import { NgHttpLoaderModule } from 'ng-http-loader';

import { PRODUCTION_ROUTE, ProductionComponent } from './';


@NgModule({
  imports: [OnesortParcelsSharedModule, NgHttpLoaderModule.forRoot(), RouterModule.forRoot([PRODUCTION_ROUTE], { useHash: true })],
  declarations: [ProductionComponent],
  entryComponents: [],
  providers: [],
  schemas: [CUSTOM_ELEMENTS_SCHEMA]
})

export class OnesortParcelsAppProductionModule {}
production.component.html:

<ng-http-loader [filteredMethods]="['GET', 'POST']"></ng-http-loader>

版本: Angular命令行界面:8.3.1 节点:13.11.0 OS: win32 x64 Angular: 8.2.4

版本: "dependencies":{ "@angular/common": "8.2.4", "@angular/compiler": "8.2.4", "@angular/core": "8.2.4", "@angular/forms": "8.2.4", "@angular/platform-browser": "8.2.4", "@angular/platform-browser-动态": "8.2.4", "@angular/router": "8.2.4", "@fortawesome/angular-fontawesome": "0.5.0", "@fortawesome/fontawesome-svg-core": "1.2.22", "@fortawesome/free-solid-svg-icons": "5.10.2", "@ng-bootstrap/ng-bootstrap": "^5.2.1", "@ngx-translate/core": "11.0.1", "@ngx-translate/http-loader": "4.0.0", "bootstrap": "4.3.1", "core-js": "3.2.1", "moment": "2.24.0", "ng-http-loader": "^7.0.0",

ng-http-loader 版本 7.0.0 有重大更改,请尝试安装 "ng-http-loader": "^6.0.1",错误应该会消失。