yagajs / leaflet-ng2

Angular.io integration of Leaflet
https://leaflet-ng2.yagajs.org
ISC License
66 stars 26 forks source link

ERROR in YagaModule is not an NgModule #190

Closed mattb103190 closed 7 years ago

mattb103190 commented 7 years ago

I can't seem to get angular to run after importing the yaga module.

Message: ERROR in YagaModule is not an NgModule

ERROR in ./~/@yaga/leaflet-ng2/index.js Module not found: Error: Can't resolve './lib/index' in '/home/matt/src/mototrax-webui/node_modules/@yaga/leaflet-ng2'

Deps: "@angular/common": "^2.4.5", "@angular/compiler": "^2.4.5", "@angular/core": "^2.4.5", "@angular/forms": "^2.4.5", "@angular/http": "^2.4.5", "@angular/platform-browser": "^2.4.5", "@angular/platform-browser-dynamic": "^2.4.5", "@angular/router": "^3.4.5", "@ng-bootstrap/ng-bootstrap": "^1.0.0-alpha.20", "@types/leaflet": "^1.0.56", "@yaga/leaflet-ng2": "^1.0.0-rc3",

Any help would be appreciated.

atd-schubert commented 7 years ago

It seems that we forgot to transpile the library before publishing it on npm. I am going to make a new RC next week for our talk at the FOSSGIS conference in Passau.

@mattb103190 maybe you will able to fix it earlier by running tsc ngc inside the leaflet-ng2 module folder. It should be /home/matt/src/mototrax-webui/node_modules/@yaga/leaflet-ng2 in your case...

Update: use ngc instead of tsc. ngc is a CLI from the npm package @angular/compiler-cli. Maybe you have to install it (as global dependency) first...

atd-schubert commented 7 years ago

In order to create modules for the ng-cli it seems that we have to transpile it with ngc instad of tsc! See: https://angular.io/docs/ts/latest/cookbook/aot-compiler.html#!#compile

atd-schubert commented 7 years ago

Use ngc instead of tsc for module tranpilation

atd-schubert commented 7 years ago

See PR #194

atd-schubert commented 7 years ago

@mattb103190 the pull request #194 should fix your problem...

atd-schubert commented 7 years ago

This issue should be solved in the newly release