abp
abp copied to clipboard
Property 'toLocalISOString' is missing in type 'ZonedDate' but required in type 'Date'.
Using npm to install dependencies and build the Angular app causes the error in the title. However, using Yarn to install dependencies and build does not produce any errors.
The error occurs even after clearing cache, any lock files, and manually removing the node_modules directory.
This seems to be some conflict between one of ABP's JavaScript libraries and one of Kendo's dependencies.
Full error output
ERROR in node_modules/@progress/kendo-date-math/dist/npm/tz/zoned-date.d.ts:38:22 - error TS2420: Class 'ZonedDate' incorrectly implements interface 'Date'.
Property 'toLocalISOString' is missing in type 'ZonedDate' but required in type 'Date'.
38 export declare class ZonedDate implements Date {
~~~~~~~~~
node_modules/@abp/ng.core/lib/utils/date-extensions.d.ts:4:9
4 toLocalISOString(): string;
~~~~~~~~~~~~~~~~~~~~~~~~~~~
'toLocalISOString' is declared here.
package.json
{
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"start:hmr": "ng serve --configuration hmr",
"build": "ng build",
"build:prod": "ng build --prod",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@abp/ng.account": "^1.0.2",
"@abp/ng.identity": "^1.0.2",
"@abp/ng.setting-management": "^1.0.2",
"@abp/ng.tenant-management": "^1.0.2",
"@angular-mdc/web": "^3.2.1",
"@angular/animations": "~8.2.11",
"@angular/common": "~8.2.11",
"@angular/compiler": "~8.2.11",
"@angular/core": "~8.2.11",
"@angular/forms": "~8.2.11",
"@angular/platform-browser": "~8.2.11",
"@angular/platform-browser-dynamic": "~8.2.11",
"@angular/router": "~8.2.11",
"@progress/kendo-angular-buttons": "^5.0.0",
"@progress/kendo-angular-common": "^1.0.0",
"@progress/kendo-angular-dateinputs": "^4.0.0",
"@progress/kendo-angular-dropdowns": "^4.0.0",
"@progress/kendo-angular-excel-export": "^3.0.0",
"@progress/kendo-angular-grid": "^4.4.0",
"@progress/kendo-angular-inputs": "^6.0.0",
"@progress/kendo-angular-intl": "^2.0.0",
"@progress/kendo-angular-l10n": "^2.0.0",
"@progress/kendo-angular-pdf-export": "^2.0.0",
"@progress/kendo-angular-popup": "^3.0.0",
"@progress/kendo-data-query": "^1.0.0",
"@progress/kendo-drawing": "^1.0.0",
"@progress/kendo-theme-default": "latest",
"lodash.merge": "^4.6.2",
"ngx-highlightjs": "^4.0.0",
"rxjs": "~6.4.0",
"tslib": "^1.10.0",
"uuid": "^3.3.3",
"zone.js": "~0.9.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.803.12",
"@angular/cli": "~8.3.12",
"@angular/compiler-cli": "~8.2.11",
"@angular/language-service": "~8.2.11",
"@angularclass/hmr": "^2.1.3",
"@ngxs/hmr-plugin": "^3.5.0",
"@ngxs/logger-plugin": "^3.5.1",
"@types/jasmine": "~3.3.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.12.7",
"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",
"ngxs-schematic": "^1.1.9",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.15.0",
"typescript": "^3.7.2"
}
}
This issue is now occurring in Yarn as well. yarn.lock
It's fixed. You can remove the node_modules/@abp/ng.core/lib/utils/date-extensions.d.ts file to hide errors until the v2.0.1 is released.