Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
TypeError: Cannot read property 'replace' of undefined (lib.js:282) #210
The command line arguments i used for ios-sim:
Get a list of simulators.
TypeError: Cannot read property 'replace' of undefined in ios-sim/src/lib.js:282
Steps to reproduce the problem
Run "./platforms/ios/cordova/lib/list-emulator-images" in your cordova project.
Please run the commands below in your Terminal.app and include it in the issue. Check when done and include results below.
System Software Overview:
The solution for myself, because i don't need the "iPad Pro (10.5-inch)" simulator if it even works (who knows):
The problem is that the
I fixed this bug by adding an if statements which checks if the device is defined in "platforms/ios/cordova/node_modules/ios-sim/src/lib.js:282".
I replaced this:
Link to the issue on stackoverflow: https://stackoverflow.com/a/44451292/7199922
@piotrowski no it didn't. The problem still exists. Even after the update to 5.1.0 with
Hm, maybe ios-sim is installed locally additionally? Then maybe try removing it.
(I'm trying to help people debug similar problems with Ionic, which uses Cordova under the hood: https://forum.ionicframework.com/t/error-cannot-read-property-replace-of-undefined-for-ios-sim/93663)
Anyway, i couldn't figure out, how to update the ios-sim local (inside my cordova project) package inside node_modules directory. Any idea how that could be done?
If anyone is wondering where the "local" ios-sim comes from and couldn't find the
This was referenced
Jun 14, 2017
pushed a commit
Jun 25, 2017
This solved my problem as well!!! Thanks so much @JedatKinports !!!
Please beware not to edit the ios-sim source files of the wrong node_modules folder!!!
We added a simple hook for our build process: