After updating to v2.3.0, running ionic serve causes this error. Tried this on a fresh blank project
Got the same problem, reverting to 2.2.16 made my build work again.
Ditto:
TypeError: Cannot read property 'split' of undefined
at get (/home/chrono/src/governess/client/node_modules/ionic-native/dist/esm/util.js:3:32)
at getPlugin (/home/chrono/src/governess/client/node_modules/ionic-native/dist/esm/plugins/plugin.js:23:85)
at CordovaProperty (/home/chrono/src/governess/client/node_modules/ionic-native/dist/esm/plugins/plugin.js:431:26)
at __decorate (/home/chrono/src/governess/client/node_modules/ionic-native/dist/esm/plugins/apprate.js:6:110)
at eval (/home/chrono/src/governess/client/node_modules/ionic-native/dist/esm/plugins/apprate.js:44:5)
at eval (/home/chrono/src/governess/client/node_modules/ionic-native/dist/esm/plugins/apprate.js:60:2)
at Object.<anonymous> (http://localhost:8100/build/main.js:3039:1)
at __webpack_require__ (http://localhost:8100/build/main.js:20:30)
at eval (/home/chrono/src/governess/client/node_modules/ionic-native/dist/esm/index.js:6:75)
at Object.<anonymous> (http://localhost:8100/build/main.js:2997:1)
Ionic Framework: 2.0.0-rc.5
Ionic Native: 2.3.0
Ionic App Scripts: 1.0.0
Angular Core: 2.2.1
Angular Compiler CLI: 2.2.1
Node: 4.6.1
OS Platform: Linux 4.8
Navigator Platform: Linux x86_64
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36
Same problem over here, but i did not get in working with 2.2.16 or 2.2.17
@fmoessle: 2.2.16 is working correctly here, sure that your other ionic deps and ionic itself are up-to-date?
You are right! Thanks, it works :)
Seems to be caused by 67adb23a145c8ec615e59e43d420ca7327905b75, tested master + cherry-pick of src/plugins/plugin.ts from 95410097428e939f4ee38c7d4817f696acdb18cc and the issue disappears.
Got the same issue, I after upgrading my exist project from 2.2.16 to 2.3.0 (and tried 2.2.17 and seems it has the same issue):
Uncaught TypeError: Cannot read property 'split' of undefined
at Object.get (ionic.native.js:18012)
at Object.exports.getPlugin (ionic.native.js:14412)
at CordovaProperty (ionic.native.js:14824)
at __decorate (ionic.native.js:1018)
at ionic.native.js:1056
at Object.8../plugin (ionic.native.js:1072)
at s (ionic.native.js:1)
at ionic.native.js:1
at Object.1../ng1 (ionic.native.js:12)
at s (ionic.native.js:1)
at e (ionic.native.js:1)
at ionic.native.js:1
ionic-cli 2.2.1
Ionic Framework: 1.3.2
This does indeed appear to be caused by 67adb23a145c8ec615e59e43d420ca7327905b75, which was a fix to #954. This change did two things, only the second of which was necessary for the bug it was intended to fix:
Replace multiple calls to getPlugin(target.pluginRef) with a single call that happens at the top of the function.
Return null instead of {} when the exists() call returns false.
The exception is occurring because of change 1. The CordovaProperty decorator is attempting to access target.pluginRef, which is not yet defined. It is the Plugin decorator which defines this property, but this is executed only after the CordovaProperty decorator, which in turn is executed only after the class in which the property is defined is called.
I believe the solution is to move the calls to getPlugin back to where they were before; this will mean the CordovaProperty decorator will be executed before the getPlugin calls, and thus target.pluginRef will at that point be defined.
Same problem over here, but i did not get in working with 2.2.16 or 2.2.17
buddy how to revert this
Please help me ...
Most helpful comment
@fmoessle: 2.2.16 is working correctly here, sure that your other ionic deps and ionic itself are up-to-date?