I have an Angular application and using PhpStorm. After upgrading to Angular 5 (via npm, etc.) I have some confusing issues.
All Promise<MyClass>marked as cause of the "Promise is not shared" error .
When testing the Promise class, I got a choice between the interface and the class inside "index.d.ts". (in node_modules for Promises_es6 and @jquery). As usual, both are common.
I obviously have an error in my configuration. Can someone help me find it?
Here are the configs:
package.json:
{
"name": "my-site",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@agm/core": "^1.0.0-beta.1",
"@angular/animations": "^5.0.1",
"@angular/cdk": "^5.0.0-rc0",
"@angular/common": "^5.0.1",
"@angular/compiler": "^5.0.1",
"@angular/core": "^5.0.1",
"@angular/forms": "^5.0.1",
"@angular/http": "^5.0.1",
"@angular/material": "^5.0.0-rc0",
"@angular/platform-browser": "^5.0.1",
"@angular/platform-browser-dynamic": "^5.0.1",
"@angular/router": "^5.0.1",
"@types/es6-promise": "0.0.33",
"ap-angular2-fullcalendar": "^1.3.5",
"bootstrap": "^3.3.7",
"core-js": "^2.4.1",
"font-awesome": "^4.7.0",
"hammerjs": "^2.0.8",
"jquery": "^3.2.1",
"material-design-icons": "^3.0.1",
"rxjs": "^5.4.1",
"zone.js": "^0.8.17"
},
"devDependencies": {
"@angular/cli": "^1.5.2",
"@angular/compiler-cli": "^5.0.1",
"@angular/language-service": "^5.0.1",
"@types/jasmine": "~2.6.3",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~8.0.51",
"codelyzer": "~4.0.1",
"jasmine-core": "~2.8.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.2.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.2.0",
"ts-node": "~3.3.0",
"tslint": "~5.8.0",
"typescript": "^2.4.2",
"uglifyjs-webpack-plugin": "^1.0.1"
}
}
tsconfig.json
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "ESNext",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"dom"
]
}
}
tsconfig.app.json
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"baseUrl": "./",
"module": "es2015",
"types": []
},
"exclude": [
"test.ts",
"**/*.spec.ts"
]
}

EDIT: Promise throw an error while creating -prod build (work on creating dev)
buildin --prod. . , :
main.3933c1a670523b7e59b4.bundle.js:1 ERROR TypeError: Cannot read property '_moduleDoBootstrap' of undefined
at e.donePromise.then (main.3933c1a670523b7e59b4.bundle.js:1)
at e.invoke (polyfills.20052382fb9ecf29cee5.bundle.js:1)
at Object.onInvoke (main.3933c1a670523b7e59b4.bundle.js:1)
at e.invoke (polyfills.20052382fb9ecf29cee5.bundle.js:1)
at r.run (polyfills.20052382fb9ecf29cee5.bundle.js:1)
at polyfills.20052382fb9ecf29cee5.bundle.js:1
at e.invokeTask (polyfills.20052382fb9ecf29cee5.bundle.js:1)
at Object.onInvokeTask (main.3933c1a670523b7e59b4.bundle.js:1)
at e.invokeTask (polyfills.20052382fb9ecf29cee5.bundle.js:1)
at r.runTask (polyfills.20052382fb9ecf29cee5.bundle.js:1)
(anonymous) @ main.3933c1a670523b7e59b4.bundle.js:1
handleError @ main.3933c1a670523b7e59b4.bundle.js:1
t.runOutsideAngular @ main.3933c1a670523b7e59b4.bundle.js:1
e.invoke @ polyfills.20052382fb9ecf29cee5.bundle.js:1
r.run @ polyfills.20052382fb9ecf29cee5.bundle.js:1
runOutsideAngular @ main.3933c1a670523b7e59b4.bundle.js:1
n.catch.n @ main.3933c1a670523b7e59b4.bundle.js:1
e.invoke @ polyfills.20052382fb9ecf29cee5.bundle.js:1
onInvoke @ main.3933c1a670523b7e59b4.bundle.js:1
e.invoke @ polyfills.20052382fb9ecf29cee5.bundle.js:1
r.run @ polyfills.20052382fb9ecf29cee5.bundle.js:1
(anonymous) @ polyfills.20052382fb9ecf29cee5.bundle.js:1
e.invokeTask @ polyfills.20052382fb9ecf29cee5.bundle.js:1
onInvokeTask @ main.3933c1a670523b7e59b4.bundle.js:1
e.invokeTask @ polyfills.20052382fb9ecf29cee5.bundle.js:1
r.runTask @ polyfills.20052382fb9ecf29cee5.bundle.js:1
o @ polyfills.20052382fb9ecf29cee5.bundle.js:1
Promise resolved (async)
r @ polyfills.20052382fb9ecf29cee5.bundle.js:1
e.scheduleTask @ polyfills.20052382fb9ecf29cee5.bundle.js:1
onScheduleTask @ polyfills.20052382fb9ecf29cee5.bundle.js:1
e.scheduleTask @ polyfills.20052382fb9ecf29cee5.bundle.js:1
r.scheduleTask @ polyfills.20052382fb9ecf29cee5.bundle.js:1
r.scheduleMicroTask @ polyfills.20052382fb9ecf29cee5.bundle.js:1
c @ polyfills.20052382fb9ecf29cee5.bundle.js:1
e.then @ polyfills.20052382fb9ecf29cee5.bundle.js:1
appInitializer @ main.3933c1a670523b7e59b4.bundle.js:1
runInitializers @ main.3933c1a670523b7e59b4.bundle.js:1
n @ main.3933c1a670523b7e59b4.bundle.js:1
(anonymous) @ main.3933c1a670523b7e59b4.bundle.js:1
n.run @ main.3933c1a670523b7e59b4.bundle.js:1
e.invoke @ polyfills.20052382fb9ecf29cee5.bundle.js:1
onInvoke @ main.3933c1a670523b7e59b4.bundle.js:1
e.invoke @ polyfills.20052382fb9ecf29cee5.bundle.js:1
r.run @ polyfills.20052382fb9ecf29cee5.bundle.js:1
run @ main.3933c1a670523b7e59b4.bundle.js:1
bootstrapModuleFactory @ main.3933c1a670523b7e59b4.bundle.js:1
cDNt @ main.3933c1a670523b7e59b4.bundle.js:1
n @ inline.81a18cab7f77e5e3b05a.bundle.js:1
0 @ main.3933c1a670523b7e59b4.bundle.js:1
n @ inline.81a18cab7f77e5e3b05a.bundle.js:1
window.webpackJsonp @ inline.81a18cab7f77e5e3b05a.bundle.js:1
(anonymous) @ main.3933c1a670523b7e59b4.bundle.js:1
main.3933c1a670523b7e59b4.bundle.js:1 ERROR Error: Uncaught (in promise): TypeError: Cannot read property '_moduleDoBootstrap' of undefined
TypeError: Cannot read property '_moduleDoBootstrap' of undefined
at e.donePromise.then (main.3933c1a670523b7e59b4.bundle.js:1)
...