Plugin is not defined

Hi. I’ve got the error Uncaught ReferenceError: plugin is not defined. It is point googlemaps.js. I use it anywhere. My app has some cordova plugins but don’t has the plugin.

com.phonegap.plugins.PushPlugin 2.5.0 "PushPlugin"
cordova-plugin-console 1.0.3 "Console"
cordova-plugin-crosswalk-webview 1.7.0 "Crosswalk WebView Engine"
cordova-plugin-device 1.1.2 "Device"
cordova-plugin-splashscreen 3.2.2 "Splashscreen"
cordova-plugin-statusbar 2.1.3 "StatusBar"
cordova-plugin-whitelist 1.2.2 "Whitelist"
ionic-plugin-keyboard 2.2.0 “Keyboard”

1 Like

I have the same problem, Have you found a solution? I have no idea why my project left work

I have the same problem… It was fine yesterday. Not sure what changed overnight.

Just want to ping this and say I’m also having a similar issue. It only seems to be on a clean install of ionic2 within the last 8 hours or so.

For those with this issue that aren’t using googlemaps and don’t need this code to actually work a simple, albeit ugly, workaround is to comment out the offending codeblock within www/build/js/app.bundle.js:

exports.GoogleMapsEvents {
    MAP_READY: plugin.google.maps.event.MAP_READY,
    MAP_CLICK: plugin.google.maps.event.MAP_CLICK,
    MAP_LONG_CLICK: plugin.google.maps.event.MAP_LONG_CLICK,
    MY_LOCATION_BUTTON_CLICK: plugin.google.maps.event.MY_LOCATION_BUTTON_CLICK,
    CAMERA_CHANGE: plugin.google.maps.event.CAMERA_CHANGE,
    CAMERA_IDLE: plugin.google.maps.event.CAMERA_IDLE,
    MAP_LOADED: plugin.google.maps.event.MAP_LOADED,
    MAP_WILL_MOVE: plugin.google.maps.event.MAP_WILL_MOVE,
    MAP_CLOSE: plugin.google.maps.event.MAP_CLOSE,
    MARKER_CLICK: plugin.google.maps.event.MARKER_CLICK,
    INFO_CLICK: plugin.google.maps.event.INFO_CLICK,
    MARKER_DRAG: plugin.google.maps.event.MARKER_DRAG,
    MARKER_DRAG_START: plugin.google.maps.event.MARKER_DRAG_START,
    MARKER_DRAG_END: plugin.google.maps.event.MARKER_DRAG_END,
    OVERLAY_CLICK: plugin.google.maps.event.OVERLAY_CLICK
}

Note that if you’re using ionic watch you’ll have to do this a lot…

1 Like

Same thing here, problem happen on fresh install of ionic2.

It seems that the problem is caused by the latest updates to ionic-native.

There’s an open issue about it - I would recommend you to vote/comment there.

As a workaround you can use an older version of ionic-native:

3 Likes

Thanks. I downgrade ionic native version. It’s working now.

Actually it’s already fixed so you could now use the latest version of ionic-native:

I update ionic-native v1.2.4. Not showing any problem. Working. Thanks…

In 1.3.9 bug comes again , plugin is not defined on serve and on android build.
D/StatusBar.MSimNetworkController( 1192): refreshSignalCluster, mMSimPhoneSignalIconId[0]=com.android.systemui:drawable/old_stat_sys_signal_4_fully mMSimDataSignalIconId[0]=com.android.systemui:drawable/old_stat_sys_signal_4_fully mMSimDataTypeIconId[0]=com.android.systemui:drawable/stat_sys_data_fully_connected_4g mMSimMobileActivityIconId[0]=(null) mNoMSimIconId[0]=(null)
I/chromium(15111): [INFO:CONSOLE(33659)] "EXCEPTION: Error: Uncaught (in promise): EXCEPTION: Error in :0:0
I/chromium(15111): ORIGINAL EXCEPTION: ReferenceError: plugin is not defined
I/chromium(15111): ORIGINAL STACKTRACE:
I/chromium(15111): ReferenceError: plugin is not defined
I/chromium(15111): at new GoogleMap (file:///android_asset/www/build/js/app.bundle.js:73664:32)

1 Like

i have same problem using 1.3.10 with google maps.

EXCEPTION: ReferenceError: plugin is not defined

STACK:
13:25:53.411 STACKTRACE:1 app.bundle.js:44024:13
[312]</BrowserDomAdapter</BrowserDomAdapter.prototype.logError() app.bundle.js:44024
[17]</ExceptionHandler</ExceptionHandler.prototype.call() app.bundle.js:1682
ApplicationRef_/<() app.bundle.js:25510
[14]</EventEmitter</EventEmitter.prototype.subscribe/schedulerFn<() app.bundle.js:1152
[575]</SafeSubscriber</SafeSubscriber.prototype.__tryOrUnsub() app.bundle.js:94359
[575]</SafeSubscriber</SafeSubscriber.prototype.next() app.bundle.js:94308
[575]</Subscriber</Subscriber.prototype._next() app.bundle.js:94258
[575]</Subscriber</Subscriber.prototype.next() app.bundle.js:94222
[573]</Subject</Subject.prototype._finalNext() app.bundle.js:94014
[573]</Subject</Subject.prototype._next() app.bundle.js:94006
[573]</Subject</Subject.prototype.next() app.bundle.js:93963
[14]</EventEmitter</EventEmitter.prototype.emit() app.bundle.js:1140
NgZone/this._zoneImpl<.onError() app.bundle.js:36977
NgZoneImpl/this.inner<.onHandleError() app.bundle.js:37185
Zone</ZoneDelegate</ZoneDelegate.prototype.handleError() zone.js:327
Zone</Zone</Zone.prototype.runGuarded() zone.js:233
Zone</Zone</Zone.prototype.wrap/<() zone.js:206

GoogleMap@http://localhost:8100/build/js/app.bundle.js:88460:9
[2]</HomePage</HomePage.prototype.initMap/<@http://localhost:8100/build/js/app.bundle.js:83:23
Zone</ZoneDelegate</ZoneDelegate.prototype.invoke@http://localhost:8100/build/js/zone.js:323:20
NgZoneImpl/this.inner<.onInvoke@http://localhost:8100/build/js/app.bundle.js:37164:32
Zone</ZoneDelegate</ZoneDelegate.prototype.invoke@http://localhost:8100/build/js/zone.js:322:20
Zone</Zone</Zone.prototype.runGuarded@http://localhost:8100/build/js/zone.js:230:29
Zone</Zone</Zone.prototype.wrap/<@http://localhost:8100/build/js/zone.js:206:25