question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

latest node-simctl breaks appium with an error "Cannot read property 'async' of undefined"

See original GitHub issue

The problem

Reinstalling appium breaks the workflow. This is an example error produced when running tests:

[XCUITest] TypeError: Cannot read property 'async' of undefined
[XCUITest]     at getDevices (/Users/distiller/project/node_modules/node-simctl/build/lib/simctl.js:1094:30)
[XCUITest]     at /Users/distiller/project/node_modules/appium-xcuitest-driver/lib/simulator-management.js:34:25
[XCUITest]     at Generator.next (<anonymous>)
[XCUITest]     at asyncGeneratorStep (/Users/distiller/project/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
[XCUITest]     at _next (/Users/distiller/project/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
[XCUITest]     at /Users/distiller/project/node_modules/@babel/runtime/helpers/asyncToGenerator.js:32:7
[XCUITest]     at new Promise (<anonymous>)
[XCUITest]     at /Users/distiller/project/node_modules/@babel/runtime/helpers/asyncToGenerator.js:21:12
[XCUITest]     at _getExistingSim (/Users/distiller/project/node_modules/appium-xcuitest-driver/build/lib/simulator-management.js:94:26)
[XCUITest]     at getExistingSim (/Users/distiller/project/node_modules/appium-xcuitest-driver/build/lib/simulator-management.js:47:26)
[XCUITest]     at /Users/distiller/project/node_modules/appium-xcuitest-driver/lib/driver.js:716:24
[XCUITest]     at Generator.next (<anonymous>)
[XCUITest]     at asyncGeneratorStep (/Users/distiller/project/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
[XCUITest]     at _next (/Users/distiller/project/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
[XCUITest]     at /Users/distiller/project/node_modules/@babel/runtime/helpers/asyncToGenerator.js:32:7
[XCUITest]     at new Promise (<anonymous>)
[XCUITest]     at /Users/distiller/project/node_modules/@babel/runtime/helpers/asyncToGenerator.js:21:12
[XCUITest]     at XCUITestDriver.determineDevice (/Users/distiller/project/node_modules/appium-xcuitest-driver/lib/driver.js:673:28)
[XCUITest]     at determineDevice (/Users/distiller/project/node_modules/appium-xcuitest-driver/lib/driver.js:254:51)
[XCUITest]     at Generator.next (<anonymous>)
[XCUITest]     at asyncGeneratorStep (/Users/distiller/project/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
[XCUITest]     at _next (/Users/distiller/project/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
[MJSONWP] Encountered internal error running command: TypeError: Cannot read property 'async' of undefined
[MJSONWP]     at getDevices (/Users/distiller/project/node_modules/node-simctl/build/lib/simctl.js:1094:30)
[MJSONWP]     at /Users/distiller/project/node_modules/appium-xcuitest-driver/lib/simulator-management.js:34:25
[MJSONWP]     at Generator.next (<anonymous>)
[MJSONWP]     at asyncGeneratorStep (/Users/distiller/project/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
[MJSONWP]     at _next (/Users/distiller/project/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
[MJSONWP]     at /Users/distiller/project/node_modules/@babel/runtime/helpers/asyncToGenerator.js:32:7
[MJSONWP]     at new Promise (<anonymous>)
[MJSONWP]     at /Users/distiller/project/node_modules/@babel/runtime/helpers/asyncToGenerator.js:21:12
[MJSONWP]     at _getExistingSim (/Users/distiller/project/node_modules/appium-xcuitest-driver/build/lib/simulator-management.js:94:26)
[MJSONWP]     at getExistingSim (/Users/distiller/project/node_modules/appium-xcuitest-driver/build/lib/simulator-management.js:47:26)
[MJSONWP]     at /Users/distiller/project/node_modules/appium-xcuitest-driver/lib/driver.js:716:24
[MJSONWP]     at Generator.next (<anonymous>)
[MJSONWP]     at asyncGeneratorStep (/Users/distiller/project/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
[MJSONWP]     at _next (/Users/distiller/project/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
[MJSONWP]     at /Users/distiller/project/node_modules/@babel/runtime/helpers/asyncToGenerator.js:32:7
[MJSONWP]     at new Promise (<anonymous>)
[MJSONWP]     at /Users/distiller/project/node_modules/@babel/runtime/helpers/asyncToGenerator.js:21:12
[MJSONWP]     at XCUITestDriver.determineDevice (/Users/distiller/project/node_modules/appium-xcuitest-driver/lib/driver.js:673:28)
[MJSONWP]     at determineDevice (/Users/distiller/project/node_modules/appium-xcuitest-driver/lib/driver.js:254:51)
[MJSONWP]     at Generator.next (<anonymous>)
[MJSONWP]     at asyncGeneratorStep (/Users/distiller/project/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
[MJSONWP]     at _next (/Users/distiller/project/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)

Fixing node-simctl to version 3.16.0 fixes the issue. Installing node-simctl@3.17.0 reproduces the issue again.

Environment

  • Appium version (or git revision) that exhibits the issue: 1.8.1 and up
  • Last Appium version that did not exhibit the issue (if applicable): Not applicable
  • Desktop OS/version used to run Appium: OS X

Details

Extra question - Appium package seems to be very prone to breaking from updated dependencies. Is there any reason not to fix dependency versions so that it doesn’t break out of the blue? I see that for node-simctl the package.json is specifying the following range:

        "from": "node-simctl@>=3.11.5 <4.0.0",

Why not fix it to something?

Thank you.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dpgrahamcommented, Nov 3, 2018

I just went ahead and unpublished 3.17.0 given that something I did in the publish yesterday obviously broke it. I’ll dig into it some more and then publish a new version shortly.

@seavan There’s a bug in Appium 1.8 (when using npm@5) that causes shrinkwrap to be ignored, and that’s why it’s installing the latest versions of packages. I would recommend that you should either upgrade to 1.9 or install 1.8 with npm@3

0reactions
lock[bot]commented, Nov 6, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unhandled error: TypeError: Cannot read property 'path' of ...
error : Unhandled error: TypeError: Cannot read property 'path' of undefined. This issue get resolved when i delete by code and checkout again...
Read more >
Appium error: uncaughtException: Cannot read property ...
Update the appium version to stable latest version 1.4.0. But the error is still remaining. Update the Node JS. Xcode is always opened...
Read more >
appium | Yarn - Package Manager
Appium is an open-source, cross-platform test automation tool for native, hybrid, and mobile web and desktop apps. We support simulators (iOS), ...
Read more >
3. How to connect to a mobile device using Appium?
“An unknown server-side error occurred while processing the command. Original error: Cannot read property 'toLowerCase' of undefined”.
Read more >
Appium iOS Driver - GithubHelp
Appium iOS Driver is a test automation tool for iOS devices up to an ... error running command: TypeError: Cannot read property 'ELEMENT'...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found