Looks like Ionic Insights/analytics is already active and is blowing up my app

I suddently started getting these erors with IONIC SERVE. Not sure what change I made which caused this. Btw, notice that it says “Insights.normalizeDevicePlatform and Insights.markActive”. I though the insights product is not released yet, why is that trying to do stuff ??? Is this a bug?

Chrome Debugger shows these errors in the console on a continuous basis.

Stuff I have tried to fix it in last 4 hours

  1. Did the obvious - uninstall and reinstall cordova-plugin-device
  • ionic plugin add cordova-plugin-device
  1. Deleted node_modules folder and re-ran NPM INSTALL

  2. Uninstall and reinstall ionic, cordova and updated NPM

  • npm uninstall cordova ionic
  • npm cache clean -f
  • npm install npm -g
  • npm install cordova ionic -g

But the problem refuses to go away. More Info

same problem. can anyone help with this

I had the same issue trying to use the Push plugin.
Are you injecting any of the cloud plugins into your constructor as the docs suggest?

The solution I’ve found was to not inject in the constructor but to do it inside of the platform.ready() method, which solved my problem.

Actually, the problem had to be solved in a different way. Just make sure that you’re a not injecting any of the cloud plugins on your main component. Apparently, they request information from other cordova plugins such as Device plugin, and those infos are only available after the platform ready is triggered. So make sure you inject the plugins anywhere else but your main component and only after the platform ready is triggered.

In that way, the implementation above does not solve the issue and you can follow the instructions provided by the http://docs.ionic.io/services/ docs.

@rafaelfuentes, It removes error but then it gives error push.register() is not a function.
& i am using push notification. i need it in main component so i can process it for all screens.

hey, same problem can anyone help ?

hey guys, for me same problem but when am building the app am getting with no errors. push is functioning

First, put all your Push logic into a service. At the service constructor, only call push methods after the platform.ready() resolves and only if platform is cordova. ex;

Add the service to your “providers”, at app.module.
Then, inside of your “rootPage”, just inject the service at your constructor and you’re good to go.

That works perfectly for me, no errors unless I try to use the push methods without the cordova platform available.

The same also works for other cloud plugins I’ve used so far, including auth and hot deployment.

Hope that helps and sorry for the long delay on the answer.