错误无法将类型实体 i9.NgxFileDropModule 解析为符号

Par*_*rul 8 angular angular-library

我已将 Angular 8 迁移到版本 10。应用程序正在使用自定义 Angular 库,该库也从版本 7 迁移到版本 10。该库具有 NgxFileDropModule,导入为

(import { NgxFileDropModule } from 'ngx-file-drop';)
Run Code Online (Sandbox Code Playgroud)

但在主应用程序中抛出错误无法将类型实体 i9.NgxFileDropModule 解析为符号 我该如何摆脱此问题 Ps 库编译和构建良好,但主应用程序抛出依赖于库的错误

Fra*_*oni 4

我在使用包目标本地获取库时遇到了类似的问题file:。我的解决方案是设置projects.PROJECTNAME.architect.build.options.preserveSymlinkstrue.

例如

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "PROJECTNAME": {
      "projectType": "application",
      "schematics": {
        // ...
      },
      // ...
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            // ...
            "scripts": [],
            "preserveSymlinks": true // <-- This line here
          }
          // Remaining configuration...
Run Code Online (Sandbox Code Playgroud)