Angular проект локально работает нормально, но при его сборке выдает ошибку в редакторе Quill - PullRequest
1 голос
/ 26 января 2020

Я использую angular 8 + quill для своего проекта, и все отлично работает в локальной сети с ng serve. но когда я попытался развернуть это, я получаю проблему ниже. Я смотрю на многие вопросы, и ничего не работает для меня. обновление angular, удаление node_module и т. д.!

это ошибка, которую я получаю

ОШИБКА в ./node_modules/ngx-quill/fesm2015/ngx -quill. js Сборка модуля завершилась неудачно (из ./node_modules/@angular-devkit/build-optimizer/src/build-optimizer/webpack-loader.js): TypeError: Невозможно прочитать свойство «kind» of не определено в isAngularDecoratorMetadataExpression (/Users/liyanaarachchi/XXXXXX/iXXXXX/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:265:35 / liaraNoch (forNode) для checkNode XXXX / iXXXt / node_modules / @ angular -devkit / build-optimizer / src / transforms / scrub-file. js: 77: 21) в visitNodes (/ Users / liyanaarachchi / iXXX / iXXXX / node_modules / typescript / lib /typescript.js:16514:30) в Object.forEachChild (/Users/liyanaarachchi/xxxx/iXXXXXX/node_modules/typescript/lib/typescript.js:16740:24) в checkNodeForDecorators (/ Users / liyanaarachchi / iyanaXXchi ii /XXXXXX/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:68:31) at visitNode (/Users/liyanaarachchi/XXXX/XXXX/node_modules/typescript/lib/typescript.js:16505:24) в Object.forEachChild (/ Users / liyanaarachchi / ibrainmart@gmail.com/ibrainmart/node_modules/typescript/lib/typescript.js: 16635: 21) в checkNodeForDecorators / Пользователи / liyanaarachchi / ibraiXXXXm / iXXXart / node_modules / @ angular -devkit / build-optimizer / src / transforms / scrub-file. js: 68: 31) на сайте visitNode (/ Users / liyanaarachchi / ibXXXm / XXXt / node_modules) /typescript/lib/typescript.js:16505:24) в Object.forEachChild (/Users/liyanaarachchi/ibrXXXXXcom/XXXX/node_modules/typescript/lib/typescript.js:16703:24) в checkNodeForDecorators ( /liyanaarachchi/ibXXXXl.com/XXXXXt/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:68:31) в visitNode (/ Users / liyanaarachchi / ibrXXXXm / iXX node_modules / typescript / lib / typescript. js: 16505: 24) в Object.forEachChild (/Users/liyanaarachchi/XXXXXXom/ibXXXXart/node_modules/typescript/lib/typescript.js:16692:24) в checkNodeForDeco ( Пользователи / liyanaarachchi / ibraiXXXXm / ibXXXXart / node_mo dules / @ angular -devkit / build-optimizer / src / transforms / scrub-file. js: 68: 31) в visitNode (/Users/liyanaarachchi/ibXXXXX/iXXXXXart/node_modules/typescript/lib/typescript.js: 16505: 24) в Object.forEachChild (/Users/liyanaarachchi/ibrainmXXXXXm/ibXXXXXt/node_modules/typescript/lib/typescript.js:16599:21)

packge . json

   {
  "name": "ibrainmart",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@agm/core": "^1.1.0",
    "@angular/animations": "^8.1.3",
    "@angular/cdk": "^8.2.3",
    "@angular/common": "~8.1.3",
    "@angular/compiler": "~8.1.3",
    "@angular/core": "~8.1.3",
    "@angular/forms": "~8.1.3",
    "@angular/material": "^8.1.2",
    "@angular/platform-browser": "~8.1.3",
    "@angular/platform-browser-dynamic": "~8.1.3",
    "@angular/router": "~8.1.3",
    "@aws-amplify/ui": "^1.0.23",
    "@fortawesome/angular-fontawesome": "^0.5.0",
    "@fortawesome/free-solid-svg-icons": "^5.10.1",
    "@ng-bootstrap/ng-bootstrap": "^5.1.1",
    "@ng-select/ng-select": "^3.0.7",
    "angular-animate": "^1.7.8",
    "angular-bootstrap-datetimepicker": "^4.0.2",
    "angular-font-awesome": "^3.1.2",
    "angular-material": "^1.1.19",
    "angular-messages": "^1.7.8",
    "angular-multiple-select": "^1.1.3",
    "angular-popper": "^2.0.1",
    "angular-sortablejs": "^2.7.0",
    "aws-amplify": "^1.1.36",
    "aws-amplify-angular": "^3.0.11",
    "bootstrap": "^4.4.1",
    "bootstrap-table": "^1.15.3",
    "bootstrap4-toggle": "^3.5.0",
    "dropify": "^0.2.2",
    "e": "0.0.4",
    "font-awesome": "^4.7.0",
    "guid-typescript": "^1.0.9",
    "jquery": "^3.4.1",
    "material-design-icons": "^3.0.1",
    "moment": "^2.24.0",
    "ng-pick-datetime": "^7.0.0",
    "ng-sortgrid": "^1.3.3",
    "ngx-bootstrap": "^5.1.1",
    "ngx-float-button": "^1.0.0",
    "ngx-google-places-autocomplete": "^2.0.4",
    "ngx-highlightjs": "^4.0.2",
    "ngx-image-cropper": "^2.1.2",
    "ngx-image-editor": "^1.4.1",
    "ngx-paypal": "^5.0.0",
    "ngx-quill": "^7.3.12",
    "ngx-select-dropdown": "^1.1.0",
    "ngx-sortablejs": "^3.1.3",
    "open-iconic": "^1.1.1",
    "paypal-checkout": "^4.0.308",
    "popper.js": "^1.15.0",
    "quill": "^1.3.7",
    "rxjs": "~6.4.0",
    "sortablejs": "^1.10.0-rc3",
    "tslib": "^1.9.0",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.801.3",
    "@angular/cli": "^8.3.23",
    "@angular/compiler-cli": "~8.1.3",
    "@angular/language-service": "~8.1.3",
    "@types/googlemaps": "^3.39.1",
    "@types/jasmine": "~3.3.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/jquery": "^3.3.31",
    "@types/node": "~8.9.4",
    "codelyzer": "^5.0.0",
    "jasmine-core": "~3.4.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.1.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.0",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.15.0",
    "typescript": "~3.4.3"
  }
}

tsconfig. json

`{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"module": "esnext",
"moduleResolution": "node",
"importHelpers": true,
"target": "es2015",
"types": ["googlemaps"],
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2018",
"dom"
]

},

"angularCompilerOptions": {
"fullTemplateTypeCheck": false,
"strictInjectionParameters": true
}
}

`

Может кто-нибудь сказать мне, почему я получаю эту ошибку

angular. json

`{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"ibrainmart": {
"projectType": "application",
"schematics": {},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/XX",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": false,
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"./node_modules/ngx-bootstrap/datepicker/bs-datepicker.css",
"./node_modules/bootstrap/dist/css/bootstrap.min.css",
"src/styles.css",
"node_modules/ngx-select-dropdown/dist/assets/style.css"

        ],
        "scripts": [
          "node_modules/jquery/dist/jquery.min.js",
          "node_modules/bootstrap/dist/js/bootstrap.min.js",
          "node_modules/dropify/dist/js/dropify.js"


        ]
      },
      "configurations": {
        "DEV": {
          "fileReplacements": [
            {
              "replace": "src/environments/environment.ts",
              "with": "src/environments/environment.dev.ts"
            }
          ],
          "optimization": true,
          "outputHashing": "all",
          "sourceMap": false,
          "extractCss": true,
          "namedChunks": false,
          "aot": true,
          "extractLicenses": true,
          "vendorChunk": false,
          "buildOptimizer": true,
          "budgets": [
            {
              "type": "initial",
              "maximumWarning": "4mb",
              "maximumError": "5mb"
            }
          ]
        },
        "STAG": {
          "fileReplacements": [
            {
              "replace": "src/environments/environment.ts",
              "with": "src/environments/environment.stage.ts"
            }
          ],
          "optimization": true,
          "outputHashing": "all",
          "sourceMap": false,
          "extractCss": true,
          "namedChunks": false,
          "aot": true,
          "extractLicenses": true,
          "vendorChunk": false,
          "buildOptimizer": true,
          "budgets": [
            {
              "type": "initial",
              "maximumWarning": "4mb",
              "maximumError": "5mb"
            }
          ]
        },
        "PROD": {
          "fileReplacements": [
            {
              "replace": "src/environments/environment.ts",
              "with": "src/environments/environment.prod.ts"
            }
          ],
          "optimization": true,
          "outputHashing": "all",
          "sourceMap": false,
          "extractCss": true,
          "namedChunks": false,
          "aot": true,
          "extractLicenses": true,
          "vendorChunk": false,
          "buildOptimizer": true,
          "budgets": [
            {
              "type": "initial",
              "maximumWarning": "8mb",
              "maximumError": "10mb"
            }
          ]
        },
        "LIVE": {
          "fileReplacements": [
            {
              "replace": "src/environments/environment.ts",
              "with": "src/environments/environment.live.ts"
            }
          ],
          "optimization": true,
          "outputHashing": "all",
          "sourceMap": false,
          "extractCss": true,
          "namedChunks": false,
          "aot": true,
          "extractLicenses": true,
          "vendorChunk": false,
          "buildOptimizer": true,
          "budgets": [
            {
              "type": "initial",
              "maximumWarning": "4mb",
              "maximumError": "5mb"
            }
          ]
        }
      }
    },
    "serve": {
      "builder": "@angular-devkit/build-angular:dev-server",
      "options": {
        "browserTarget": "iXXXXX:build"
      },
      "configurations": {
        "production": {
          "browserTarget": "XXXX:build:production"
        }
      }
    },
    "extract-i18n": {
      "builder": "@angular-devkit/build-angular:extract-i18n",
      "options": {
        "browserTarget": "XXX:build"
      }
    },
    "test": {
      "builder": "@angular-devkit/build-angular:karma",
      "options": {
        "main": "src/test.ts",
        "polyfills": "src/polyfills.ts",
        "tsConfig": "tsconfig.spec.json",
        "karmaConfig": "karma.conf.js",
        "assets": [
          "src/favicon.ico",
          "src/assets"
        ],
        "styles": [
          "./node_modules/ngx-bootstrap/datepicker/bs-datepicker.css",
          "./node_modules/bootstrap/dist/css/bootstrap.min.css",
          "src/styles.css"
        ],
        "scripts": []
      }
    },
    "lint": {
      "builder": "@angular-devkit/build-angular:tslint",
      "options": {
        "tsConfig": [
          "tsconfig.app.json",
          "tsconfig.spec.json",
          "e2e/tsconfig.json"
        ],
        "exclude": [
          "**/node_modules/**"
        ]
      }
    },
    "e2e": {
      "builder": "@angular-devkit/build-angular:protractor",
      "options": {
        "protractorConfig": "e2e/protractor.conf.js",
        "devServerTarget": "XXX:serve"
      },
      "configurations": {
        "production": {
          "devServerTarget": "XXX:serve:production"
        }
      }
    }
  }
}
},
"defaultProject": "XXX"
}`

Ответы [ 2 ]

1 голос
/ 26 января 2020

У вас есть два решения, чтобы решить его

Если вы хотите узнать больше информации, вы можете проверить эту ссылку https://github.com/ckeditor/ckeditor4-angular/issues/78


1 , Установите buildOptimizer в false для вашей посылки. json

 "configurations": {
        "DEV": {
          ...
          "buildOptimizer": false,
        },
        "STAG": {
           ...
          "buildOptimizer": false,
        },
        "PROD": {
           ...
          "buildOptimizer": false,
        },
        "LIVE": {
          ...
          "buildOptimizer": false,
        }
      }
    },

2. Изменить версию angular -devkit

"devDependencies": { 
"@angular-devkit/architect": "~0.803.20", 
"@angular-devkit/build-angular": "~0.803.20", 
"@angular-devkit/core": "~8.3.20", 
"@angular-devkit/schematics": "~8.3.20",
 },
1 голос
/ 26 января 2020

вы можете удалить node_module, а затем вы npm install в своем терминале, если не работает, я не знаю. но по ошибке не удалось встроенный node_modul. Или, у вас обновленная версия nvm может работать

...