pubnub / pubnub-angular2

Other
33 stars 13 forks source link

Pubnub-angular2 module not compatible with Ionic 2? #13

Closed averhaegen closed 7 years ago

averhaegen commented 7 years ago

Hi, I've build an angular 2 dashboard (website) using this module and this now runs fine on my webserver. Now I'm trying to make an Ionic 2 app which also needs a pubnub connection (using this module). Ionic can use the same modules as angular 2; but this module seems to be an exception...

I tried installing the module and import it, but as soon as I initialize a connection, the ionic 2 app crashes. I'm getting a WebPack error message. I have made a detailed topic about this problems in the Ionic forums, so please have a look there: https://forum.ionicframework.com/t/error-when-using-pubnub-angular2-module-in-ionic-2/78313

As a workaround, I tried to use the regular JS pubnub. This works fine for just history calls. But when I tried to add an event-listener, the handling of incoming messages gives me out-of-scope issues. So I really need to get this Pubnub-angular2 module working inside Ionic 2!

Thank you for your time. :-)

ManuelFernando commented 7 years ago

Hi @averhaegen can you try this, using pubnub js 4.3.3

averhaegen commented 7 years ago

I was using 4.4.0 already but even after switching to 4.3.3, the error is still the same :(

ManuelFernando commented 7 years ago

Thanks for reporting this issue, we are going to fix it and will tell you when it’s ready

KevinClaeys commented 7 years ago

I have the same error when using angular-cli. So I guess its webpack related. I didn't have this issue when I used SystemJS.

@averhaegen is your working angular2 app using webpack as module bundler?

ManuelFernando commented 7 years ago

@KevinClaeys @averhaegen this issue was fixed but we could not cut a version last week. Really ionic uses rollup like bundle module and there was an incompatibility for this bundle module. When you download the new version you don’t need to reference any alias. Only declare the pubnub javascript sdk inside the html and introduce the pubnub-angular2 sdk directly in angular module or angular component ionic will do the rest.

We hope that today we can cut the version!

ManuelFernando commented 7 years ago

@KevinClaeys @averhaegen the new version is ready, please let me know if this works for you!

KevinClaeys commented 7 years ago

@ManuelFernando Tested and works! Great, thanks!

averhaegen commented 7 years ago

@ManuelFernando Yes it works! Thank you for fixing the issue so quickly! 🥇