每当我启动我的角度应用程序时,都会出现此错误:
ERROR Error: Uncaught (in promise): TypeError: Object(...) is not a function
TypeError: Object(...) is not a function
at default~app-app-module~9ca28b07.js:4519
at Module../node_modules/cdk-table-exporter/fesm5/cdk-table-exporter.js (default~app-app-module~9ca28b07.js:4521)
at __webpack_require__ (bootstrap:83)
at Module../node_modules/mat-table-exporter/fesm5/mat-table-exporter.js (default~app-app-module~9ca28b07.js:5013)
at __webpack_require__ (bootstrap:83)
at Module../src/app/app-material.module.ts (default~app-app-module~9ca28b07.js:36901)
at __webpack_require__ (bootstrap:83)
at Module../src/app/app.module.ts (it.js:47)
at __webpack_require__ (bootstrap:83)
at main-wqrng.js?v=92fb42:43
at resolvePromise (zone.js:831)
at resolvePromise (zone.js:788)
at zone.js:892
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)
at Object.onInvokeTask (core.js:17290)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:422)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:195)
at drainMicroTaskQueue (zone.js:601)
我已经尝试使用npm进行cdk-table-exporter和mat-table-exporter了,但是仍然给我这个错误。
这是package.json文件:
{
"name": "webqreteang",
"version": "1.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"build p": "ng build --prod",
"mock": "ng serve --proxy-config proxy/proxy.conf.json --open --host 0.0.0.0 --watch --configuration mock",
"mock real be": "ng serve --proxy-config proxy/proxy.be.conf.json --port 4201 --open --host 0.0.0.0 --watch --configuration mock",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "7.2.15",
"@angular/cdk": "7.3.7",
"@angular/common": "^7.2.15",
"@angular/compiler": "^7.2.15",
"@angular/core": "^7.2.15",
"@angular/forms": "^7.2.15",
"@angular/http": "^7.2.15",
"@angular/material": "7.3.7",
"@angular/material-moment-adapter": "^7.3.7",
"@angular/platform-browser": "^7.2.15",
"@angular/platform-browser-dynamic": "^7.2.15",
"@angular/platform-server": "^7.2.15",
"@angular/pwa": "^0.7.1",
"@angular/router": "^7.2.15",
"@angular/service-worker": "^7.2.15",
"@ngx-translate/core": "^11.0.1",
"@ngx-translate/http-loader": "^4.0.0",
"@standard-coop/coop-stj-menu": "^7.0.0-beta.1",
"@standard-coop/core": "^7.0.0",
"@syncfusion/ej2-angular-richtexteditor": "^17.3.28",
"angular-oauth2-oidc": "^5.0.2",
"cdk-table-exporter": "^1.2.2",
"classlist.js": "^1.1.20150312",
"core-js": "^2.5.4",
"devextreme": "^18.2.4",
"devextreme-angular": "^18.2.4",
"font-awesome": "^4.7.0",
"hammerjs": "^2.0.8",
"jquery": "^3.3.1",
"mat-table-exporter": "^1.2.2",
"moment": "^2.24.0",
"node-sass": "^4.9.2",
"rxjs": "^6.5.3",
"rxjs-compat": "^6.0.0",
"web-animations-js": "^2.3.1",
"zone.js": "^0.8.29"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.11.0",
"@angular-devkit/core": "^7.2.15",
"@angular-devkit/schematics": "^7.2.15",
"@angular/cli": "^7.3.9",
"@angular/compiler-cli": "^7.2.15",
"@angular/language-service": "^7.2.15",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.5.0",
"devextreme-cli": "1.0.1",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"json-server": "^0.12.1",
"karma": "~3.1.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "^3.2.4"
}
}
答案 0 :(得分:0)
最新版本的mat-table-exporter(1.2.2)出现一个问题,仅影响Angular 7及更低版本的用户。 您现在可以使用1.2.1,将会有一个解决此问题的版本。(issue 21)