quentinlampin / ngx-openlayers

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

Error when upgrading to @angular/cli rc.4 #55

Closed FallenRiteMonk closed 7 years ago

FallenRiteMonk commented 7 years ago

I tried updating my project to cli's rc.4 bet I get the following errors:

ERROR in <PROJECT_PATH>/node_modules/angular2-openlayers/dist/components/map.component.d.ts (3,91): Cannot find module 'openlayers'.)
<PROJECT_PATH>/node_modules/angular2-openlayers/dist/components/map.component.d.ts (1,1): Cannot find type definition file for 'openlayers'.)

ERROR in <PROJECT_PATH>/node_modules/angular2-openlayers/dist/components/controls/attribution.component.d.ts (3,25): Cannot find module 'openlayers'.)
<PROJECT_PATH>/node_modules/angular2-openlayers/dist/components/controls/attribution.component.d.ts (1,1): Cannot find type definition file for 'openlayers'.)
...

This continues for all the modules of the lib I use. Installing openlayer types (npm install --save-dev @types/openlayers) results in the following error:

ERROR in <PROJECT_PATH>/src/app/challenge/components/world/world.component.ts (111,30): Property 'getId' does not exist on type 'Feature | Feature'.)

no matter if I install version 4.0.1 or 3.20.5.

Reverting to rc.2 (there was no rc.3) fixes the problem! Any ideas what could be the problem here?

quentin-ol commented 7 years ago

Hmm, weird. Just in case, could you explicitly install openlayers as a dependency of your project:

    npm install --save openlayers

By the way, with the recent release of openlayers 4.x ( not yet supported, see #44), could you check which version is installed and report.

Thanks

FallenRiteMonk commented 7 years ago

I have done that already, but it doesn't change a thing. I tried it wit version 3.20.5 and 4.0.1

quentin-ol commented 7 years ago

Is it still relevant? #58 reports that everything runs fine on beta and supposedly on 1.0 since the issue has been closed by the author.

quentin-ol commented 7 years ago

Closing for now, please reopen if this issue still occurs.