升级到angular 8后,ng serve --prod失败,并在控制台中显示以下错误。 尽管ng-serve,ng build --prod可以工作。
我在更新后尝试了npm缓存清理,但是没有运气。
Uncaught TypeError: d is not a function
此处是供参考的package.json文件。我不确定如何进一步调试。 任何帮助将非常感激。我在这里想念东西吗?
{
"name": "client",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"compodoc": "npx compodoc -p src/tsconfig.app.json"
},
"private": true,
"dependencies": {
"@angular/animations": "^8.2.14",
"@angular/cdk": "^8.2.3",
"@angular/common": "^8.2.14",
"@angular/compiler": "^8.2.14",
"@angular/core": "^8.2.14",
"@angular/forms": "^8.2.14",
"@angular/http": "^7.1.4",
"@angular/material": "^8.2.3",
"@angular/material-moment-adapter": "^8.2.3",
"@angular/platform-browser": "^8.2.14",
"@angular/platform-browser-dynamic": "^8.2.14",
"@angular/platform-server": "^8.2.14",
"@angular/pwa": "^0.803.20",
"@angular/router": "^8.2.14",
"@angular/service-worker": "^8.2.14",
"@aspnet/signalr": "^1.0.2",
"@auth0/angular-jwt": "^2.1.0",
"@types/hammerjs": "^2.0.36",
"ag-grid-angular": "^22.0.0",
"ag-grid-community": "^22.0.0",
"ag-grid-enterprise": "^22.0.0",
"core-js": "^2.6.1",
"devextreme": "^18.1.4",
"devextreme-angular": "^18.1.4",
"dhx-spreadsheet": "^3.1.4",
"file-saver": "^2.0.2",
"hammerjs": "^2.0.8",
"jszip": "^3.1.5",
"moment": "^2.22.2",
"ngx-infinite-scroll": "^7.1.0",
"ngx-perfect-scrollbar": "^6.3.1",
"ngx-push-notifications": "^6.0.0",
"resize-observer-polyfill": "^1.5.1",
"rxjs": "^6.5.3",
"rxjs-compat": "^6.5.3",
"tslib": "^1.9.0",
"web-animations-js": "^2.3.2",
"webpack": "^4.41.2",
"zone.js": "^0.9.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.803.20",
"@angular/cli": "^8.3.20",
"@angular/compiler-cli": "^8.2.14",
"@angular/language-service": "^8.2.14",
"@types/globalize": "0.0.33",
"@types/jasmine": "^3.3.5",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^10.12.18",
"codelyzer": "^4.5.0",
"devextreme-intl": "^18.1.4",
"igniteui-cli": "~4.2.0",
"jasmine-core": "^3.3.0",
"jasmine-spec-reporter": "^4.2.1",
"karma": "^4.4.1",
"karma-chrome-launcher": "^2.2.0",
"karma-cli": "^2.0.0",
"karma-coverage-istanbul-reporter": "~2.0.0",
"karma-jasmine": "^2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"node-sass": "^4.13.0",
"protractor": "^5.4.2",
"rxjs-tslint": "^0.1.6",
"ts-node": "~5.0.1",
"tslint": "^5.12.0",
"typescript": "3.4.5"
}
}
答案 0 :(得分:4)
我在一些项目中遇到过同样的问题。我运行了npm i --save-dev @angular-devkit/build-angular@latest
,它似乎可以解决所有问题。
答案 1 :(得分:0)
如果有人遇到相同的问题。
我通过在angular.json文件中将buildOptimizer设置为false来解决了该问题