quentinlampin / ngx-openlayers

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

Unexpected value 'AngularOpenlayersModule' imported by the module 'AppModule' #31

Closed alienlike closed 7 years ago

alienlike commented 7 years ago

If I tweak tsconfig.json to bypass #26, I'm now seeing this exception at runtime:

Unexpected value 'AngularOpenlayersModule' imported by the module 'AppModule'

There are quite a few posts about this on the web, but I haven't found any fix. It seems that Angular metadata is somehow getting stripped out during compilation.

quentin-ol commented 7 years ago

👍 for finding references to this issue!

I'm currently working on a clean-up of the code (code itself+documentation). This should hit the repo soon. Hoping to solve most of the open issues !

quentin-ol commented 7 years ago

I've had similar issues with Angular2 and Typescripts version 2.1.x. As for now, angular2 is not compatible with typescript 2.1.x. Could you check which version of typescript you're using ?

alienlike commented 7 years ago

I was using TS 2.1, but after downgrading to 2.0 the problem persists.

quentin-ol commented 7 years ago

Could you copy paste the dependencies part of your package.json? Relevant items would be angular modules, e.g. @angular/core, and angular2-openlayers.

BR,

Quentin

-------- Message d'origine -------- De : Nathaniel Wingfield notifications@github.com Date : 01/01/2017 02:38 (GMT+01:00) À : quentin-ol/angular2-openlayers angular2-openlayers@noreply.github.com Cc : LAMPIN Quentin IMT/OLPS quentin.lampin@orange.com, Comment comment@noreply.github.com Objet : Re: [quentin-ol/angular2-openlayers] Unexpected value 'AngularOpenlayersModule' imported by the module 'AppModule' (#31)

I was using TS 2.1, but after downgrading to 2.0 the problem persists.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/quentin-ol/angular2-openlayers/issues/31#issuecomment-269888941, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AOYyYrkvxdDQRZCUWyS9OvVL1-DEKQpEks5rNwOsgaJpZM4LWh7_.


Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration, Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law; they should not be distributed, used or copied without authorisation. If you have received this email in error, please notify the sender and delete this message and its attachments. As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified. Thank you.

alienlike commented 7 years ago

Here you have it.

  "dependencies": {
    "@angular/common": "~2.1.0",
    "@angular/compiler": "~2.1.0",
    "@angular/core": "~2.1.0",
    "@angular/forms": "~2.1.0",
    "@angular/http": "~2.1.0",
    "@angular/platform-browser": "~2.1.0",
    "@angular/platform-browser-dynamic": "~2.1.0",
    "@angular/router": "~3.1.0",
    "angular2-openlayers": "file:../../../angular2-openlayers",
    "bootstrap": "^4.0.0-alpha.5",
    "core-js": "^2.4.1",
    "font-awesome": "^4.7.0",
    "lodash": "^4.16.6",
    "moment": "^2.15.1",
    "openlayers": "^3.19.1",
    "reflect-metadata": "^0.1.8",
    "rxjs": "5.0.0-beta.12",
    "zone.js": "^0.6.25"
  }

I have angular2-openlayers locally, at commit 06b69dbc51458b with the following change to work around #26:

diff --git a/tsconfig.json b/tsconfig.json
index 67973c0..d79ae01 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,7 +1,7 @@
 {
     "compilerOptions": {
         "noImplicitAny": true,
-        "module": "es2015",
+        "module": "commonjs",
         "moduleResolution": "node",
         "target": "es5",
         "emitDecoratorMetadata": true,
quentin-ol commented 7 years ago

this should be fixed with v0.5.0