Suddenly, when trying to create a build with webpack and AOT, i got the following error:
ERROR in node_modules/@types/jquery/index.d.ts(8186,5): error TS2717: Subsequent property declarations must have the same type. Property 'char' must be of type 'string', but here has type 'any'. node_modules/@types/jquery/index.d.ts(8188,5): error TS2717: Subsequent property declarations must have the same type. Property 'key' must be of type 'string', but here has type 'any'.
I've read several discussions about this issue, but found none that helped me out.
1) tried to clear node modules with "npm prune" and then npm install.
How to clean node_modules folder of packages that are not in package.json?
2) followed https://www.typescriptlang.org/docs/handbook/tsconfig-json.html#types-typeroots-and-types and https://github.com/ionic-team/ionic-cli/issues/3541 to check types : [] in my tsconfig :
{
"compilerOptions": {
"allowJs": true,
"module": "es6",
"target": "es5",
"baseUrl": "/",
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [
"dom",
"es7"
],
"mapRoot": "./",
"moduleResolution": "node",
"outDir": "dist/out-tsc",
"sourceMap": true,
"typeRoots": [
"node_modules/@types",
"hammerjs"
],
"types": [
"node",
"jasmine"
]
},
I don't understand why I got the error from Jquery files, since they are not supposed to be part of the compilation, If I understood correctly....
3) I even tried to just follow the error and change the "any" to a "string" type, and to see what happens. the results were a partial build with only 1 js chunk insted of 5
here are my dependencies from package.json:
"dependencies": {
"@angular-mdl/core": "^6.0.0",
"@angular/animations": "^6.1.7",
"@angular/cdk": "^6.1.0",
"@angular/common": "^6.1.9",
"@angular/compiler": "^6.0.0",
"@angular/core": "^6.0.0",
"@angular/forms": "^6.0.0",
"@angular/http": "^6.0.0",
"@angular/material": "^6.1.0",
"@angular/platform-browser": "^6.0.0",
"@angular/platform-browser-dynamic": "^6.0.0",
"@angular/platform-server": "^6.0.0",
"@angular/router": "^6.0.0",
"@angular/upgrade": "^6.0.0",
"@auth0/angular-jwt": "^1.1.0",
"@ng-bootstrap/ng-bootstrap": "^2.0.0",
"@swimlane/ngx-charts": "^7.0.1",
"@types/adal-angular": "^1.0.1",
"angular": "^1.6.9",
"angular-font-awesome": "*",
"angular2-focus": "^1.1.2",
"angular2-highcharts": "^0.5.5",
"chart.js": "^2.7.2",
"clone-deep": "^4.0.0",
"core-js": "^2.4.1",
"d3": "^4.13.0",
"deep-equal": "^1.0.1",
"file-saver": "^1.3.8",
"font-awesome": "^4.7.0",
"hammerjs": "^2.0.8",
"i": "^0.3.6",
"is-deep-equal": "^1.0.3",
"jquery": "^3.3.1",
"jsonwebtoken": "^8.2.0",
"jwt-decode": "^2.2.0",
"material-design-icons": "^3.0.1",
"microsoft-adal-angular6": "^1.3.0",
"moment": "^2.23.0",
"moment-with-locales-es6": "^1.0.1",
"ng-inline-svg": "^6.0.0",
"ng2-completer": "^1.6.3",
"ng2-dropdown-multiselect": "^1.2.0",
"ng2-file-upload": "^1.3.0",
"ng2-kw-gauge": "^0.0.8",
"ng2-password-strength-bar": "^1.2.0",
"ng2-select": "^2.0.0",
"ngc": "^1.0.0",
"ngx-bootstrap": "^2.0.3",
"ngx-pipes": "^2.1.2",
"ngx-popper": "^2.7.1",
"npm": "^6.9.0",
"object-fit-images": "^3.2.3",
"object-hash": "^1.3.0",
"popper.js": "^1.14.4",
"primeicons": "^1.0.0-beta.10",
"primeng": "^6.1.2",
"request": "^2.88.0",
"rxjs": "^6.3.3",
"rxjs-compat": "^6.1.0",
"tether": "^1.4.5",
"ts-helpers": "^1.1.2",
"webpack": "^4.8.3",
"zone.js": "^0.8.5"
},
Could you please try to help me locating the problem? how can I know what causing this, and if it is really from a collision of 2 types, how can I know which file is the root of the problem?