When I emulate Ionic App it throws TypeError: Can't call method on undefined
When I emulate Ionic App it throws TypeError: Can't call method on undefined
我正在做一个 Ionic 2 beta(最新版本)项目。
该应用程序在网络客户端上运行,没有任何错误。
但是当我尝试模拟时,我得到了一个白屏(The White Screen of Death)。
adb logcat
.
中没有错误记录
因此尝试通过实时重新加载来模拟应用程序。 (如前所述 here )。
当我执行命令时ionic emulate android -l -c
我收到这个错误:
Error happened TypeError: Can't call method on undefined
at TypeError (native)
at module.exports (D:\ionicApp\node_modules\core-js\modules\_defined.js:3:28)
at createHTML (D:\ionicApp\node_modules\core-js\modules\_string-html.js:7:19)
at bold (D:\ionicApp\node_modules\core-js\modules\es6.string.bold.js:5:12)
at cb (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\winston\lib\winston\logger.js:206:7)
at done (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\winston\node_modules\async\lib\async.js:167:19)
at C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\winston\node_modules\async\lib\async.js:40:16
at C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\winston\lib\winston\logger.js:193:9
at [object Object].Console.log (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\winston\lib\winston\transports\console.js:127:3)
at emit (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\winston\lib\winston\logger.js:186:17)
at C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\winston\node_modules\async\lib\async.js:157:13
at _each (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\winston\node_modules\async\lib\async.js:57:9)
at Object.async.each (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\winston\node_modules\async\lib\async.js:156:9)
at [object Object].Logger.log (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\winston\lib\winston\logger.js:214:9)
at [object Object].target.(anonymous function) [as info] (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\winston\lib\winston\common.js:54:18)
at Object.IonicTask.setupLiveReload (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\lib\ionic\cordova.js:338:7)
at C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\lib\ionic\cordova.js:104:21
at _fulfilled (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\q\q.js:787:54)
at self.promiseDispatch.done (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\q\q.js:816:30)
at Promise.promise.promiseDispatch (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\q\q.js:749:13)
at C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\q\q.js:509:49
at flush (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\q\q.js:108:17)
at nextTickCallbackWith0Args (node.js:456:9)
at process._tickCallback (node.js:385:13)
有没有人遇到过这个问题,您的解决方案是什么?
参考:https://forum.ionicframework.com/t/emulate-run-with-livereload-not-working/48330
latsets ionic 2 版本更新。 npm install ionic@beta
为了解决这个问题,我做了以下工作。
- 升级/降级到 Cordova 版本 6.0.0
- 升级/降级到 Ionic 版本 2.0.0-beta.25
- 离子状态重置
- 离子平台移除android
- 离子平台添加android
- 离子 运行 android
今天有效....
我正在做一个 Ionic 2 beta(最新版本)项目。
该应用程序在网络客户端上运行,没有任何错误。
但是当我尝试模拟时,我得到了一个白屏(The White Screen of Death)。
adb logcat
.
因此尝试通过实时重新加载来模拟应用程序。 (如前所述 here )。
当我执行命令时ionic emulate android -l -c
我收到这个错误:
Error happened TypeError: Can't call method on undefined
at TypeError (native)
at module.exports (D:\ionicApp\node_modules\core-js\modules\_defined.js:3:28)
at createHTML (D:\ionicApp\node_modules\core-js\modules\_string-html.js:7:19)
at bold (D:\ionicApp\node_modules\core-js\modules\es6.string.bold.js:5:12)
at cb (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\winston\lib\winston\logger.js:206:7)
at done (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\winston\node_modules\async\lib\async.js:167:19)
at C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\winston\node_modules\async\lib\async.js:40:16
at C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\winston\lib\winston\logger.js:193:9
at [object Object].Console.log (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\winston\lib\winston\transports\console.js:127:3)
at emit (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\winston\lib\winston\logger.js:186:17)
at C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\winston\node_modules\async\lib\async.js:157:13
at _each (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\winston\node_modules\async\lib\async.js:57:9)
at Object.async.each (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\winston\node_modules\async\lib\async.js:156:9)
at [object Object].Logger.log (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\winston\lib\winston\logger.js:214:9)
at [object Object].target.(anonymous function) [as info] (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\winston\lib\winston\common.js:54:18)
at Object.IonicTask.setupLiveReload (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\lib\ionic\cordova.js:338:7)
at C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\lib\ionic\cordova.js:104:21
at _fulfilled (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\q\q.js:787:54)
at self.promiseDispatch.done (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\q\q.js:816:30)
at Promise.promise.promiseDispatch (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\q\q.js:749:13)
at C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\q\q.js:509:49
at flush (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\q\q.js:108:17)
at nextTickCallbackWith0Args (node.js:456:9)
at process._tickCallback (node.js:385:13)
有没有人遇到过这个问题,您的解决方案是什么? 参考:https://forum.ionicframework.com/t/emulate-run-with-livereload-not-working/48330
latsets ionic 2 版本更新。 npm install ionic@beta
为了解决这个问题,我做了以下工作。
- 升级/降级到 Cordova 版本 6.0.0
- 升级/降级到 Ionic 版本 2.0.0-beta.25
- 离子状态重置
- 离子平台移除android
- 离子平台添加android
- 离子 运行 android
今天有效....