quentinlampin / ngx-openlayers

Angular2+ components for Openlayers 4.x
Mozilla Public License 2.0
137 stars 98 forks source link

UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: AngularOpenlayersModule is not an NgModule #32

Closed dafranklin closed 7 years ago

dafranklin commented 7 years ago

Hi guys, angular 2 beginner here, i tried to use this module and it worked for a while, then beside doing an npm install I didn't do much yet I can't get my project to work anymore. I get the error below.

When i remove "AngularOpenlayersModule " from the imports in the app.module.ts file the project works again but ofc the map doesn't display as the import isn't there.

NG Live Development Server is running on http://localhost:4200. 10% building modules 3/3 modules 0 active(node:5716) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: AngularOpenlayersModule is not an NgModule 23% building modules 112/112 modules 0 active

Anyone else got this error?

EDIT: I just understood how i got the project working. First, i remove the import of AngularOpenlayersModule in app.module.ts Then, i start ng serve. The project compiles properly. Then i add AngularOpenlayersModule in the imports of app.module.ts. The project recompile properly for some reason, and i can see the map.

EDIT2: Don't know if this helps in any way but when i use "ng serve --aot" i get this one: can't resolve module C:/JavaProjects/MovieApp/node_modules/angular2-openlayers/node_modules/@angular/core/src/di/reflective_key.d.ts from C:/JavaProject s/MovieApp/node_modules/angular2-openlayers/node_modules/@angular/core/src/di/reflective_key.d.ts (node:7988) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: can't find symbol KeyRegistry exported from module C:/JavaProjects/MovieApp/node_modules/angul ar2-openlayers/node_modules/@angular/core/src/di/reflective_key.d.ts

I have to admit this is a pretty weird problem and I'm not really sure of its source but since the only thing i change is related to this module, i thought I would ask about it here.

Kind regards

EDIT 3: This problem is recurrent with certain version of angular-cli. Using typescript 2.0.10 and angular-cli beta.24 seems to have done the trick but other errors occurs (something about makeDecorator function calls not supported)

quentin-ol commented 7 years ago

Hey @dafranklin, thanks for figuring out the issue. I think this should go in the documentation. I will create a "common problems and solution" section.
Thanks again