PushNotification is not defined, not even using the plugin!


#1

So I’m building an ionic2 app, in which I restrict pages if the user is not legged in.
When I run ionic serve, I get this error, and I’m not even using the Push plugin…

push.js:64Uncaught ReferenceError: PushNotification is not defined 

(anonymous function)	@	push.js:64
443../plugin	@	push.js:81
s	@	_prelude.js:1
(anonymous function)	@	_prelude.js:1
390../ng1	@	index.js:87
s	@	_prelude.js:1
(anonymous function)	@	_prelude.js:1
1../pages/about/about	@	app.ts:2
s	@	_prelude.js:1
e	@	_prelude.js:1
(anonymous function)	@	_prelude.js:1

Someone have an idea why this is happening?


#2

Do a quick search in you project, you must have something referencing pushNotifications in your code


#3

I am having the same issue. I am NOT using or referencing push notifications.


#4

I believe there was a problem with a 1.3.x version of ionic native but I am using 1.2.2. The error does occur in the push.js file in ionic-native. However, this just started as of Sunday. The problem was occurring on a web hosted instance of the mobile app. I was not experiencing the issue locally. Even with deleting node-modules and npm install. I created a npm-shrinkwrap file and deployed the app to the server and it magically started working. I hope this helps somebody else with the same issue.


#5

Thanks for your answer (sorry for the late reply), yes that was the case!