JoshDSommer / nativescript-ngx-slides

A NativeScript + Angular module for to add a slides component to your mobile app
Other
45 stars 34 forks source link

Unexpected values "SlidesModule" #55

Closed sfaessler closed 6 years ago

sfaessler commented 6 years ago

ERROR Error: Unexpected value 'SlidesModule' imported by the module 'AppModule'. Please add a @NgModule annotation.

After updating an old project I removed the plugin using tns plugin remove ngx-slides and re-added it. Version changed from 0.4.1 to 1.0.0 which is generally fine.

After trying to start the app the the app crashes and showns the error message above.

In app.module.ts I have this: import { SlidesModule } from 'nativescript-ngx-slides'; from package.json: "nativescript-ngx-slides": "~0.4.1", "nativescript-ngx-slides": "^1.0.0",

What have I done wrong? Seems that I'm too stupid for this world :(

Regards, Sven

sfaessler commented 6 years ago

This is my app.module.ts - from my point of view everything is correct?

https://pastebin.com/rG3LLDmB

JoshDSommer commented 6 years ago

Nothing to worry about. is nativescript-ngx-slides in your package.json listed twice? if so make sure to delete one of them and completley remove your node_modules and platforms folders, then do a new insstall . and only have the latest version installed ("^1.0.0"), I believe this error is because it's looking at an older verisoin of the package.

sfaessler commented 6 years ago

Thanks for your fast reply.

I've done:

  1. deleted hooks, node_modules aund platforms completely and removed "nativescript-ngx-slides": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/nativescript-ngx-slides/-/nativescript-ngx-slides-0.4.3.tgz", "integrity": "sha1-O8wZdSAVphjll9uqFU5FQ9szZrI=" }, from the package-lock.json file
  2. tns plugin remove nativescript-ngx-slides
  3. tns plugin add nativescript-ngx-slides
  4. tns install
  5. tns prepare ios
  6. tns run ios

Error ist still there. App crashes directly after running.

This is my package.json: https://pastebin.com/cbSCJeda - there is only a single ngx-slides entry.

Any other ideas?

Thanks for your help!

JoshDSommer commented 6 years ago

@sfaessler are you still having this issue?

sfaessler commented 6 years ago

Unfortunatelly, yes.

sfaessler commented 6 years ago

I'm trying to update all dependencies and isolate this into a new simple project.

sfaessler commented 6 years ago

Now, error message is gone. Don't ask my why. Thx for your help! Let's see which bug drives me crazy after this works now :)

sfaessler commented 6 years ago

Grrrrr, message is back! :(

mikelinden1 commented 6 years ago

I had the same problem. The solution for me was to upgrade from Angular 4.2.0 to 5.2.0 (I believe that error is thrown when there is a mismatch). @sfaessler

JoshDSommer commented 6 years ago

@mikelinden1 thank you. tonight if I have a chance I'll try that out. I haven't had a success duplicating this. however, this would make sense the angular compiler that I published it with was 5.2.0+.

sfaessler commented 6 years ago

Did that too, yesterday and solved my problem. Thanks for your help!