Skip to content

Fix crash from property 'browser_version' undefined #244

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 19, 2021

Conversation

Krinkle
Copy link
Contributor

@Krinkle Krinkle commented Apr 12, 2021

When no match is found, the process would just crash. Instead, recognise this as a normal end-user scenario and point them to the list of available workers.

In my experience the most common way to encounter this issue is when additional decimal places are required by the API, e.g. safari_9 results in a crash, because the available workers are described as "9.1" instead. Given that most browers are described without a decimal place, this is an easy mistake to make.

Another way to get this is when there is a misspelled browser name.

Before:

TypeError: Cannot read property 'browser_version' of undefined
    at browserstack-runner/bin/cli.js

After:

Error: No desktop match found for {"browser":"safari","browser_version":"9"}
Check https://www.browserstack.com/list-of-browsers-and-platforms/js_testing
    at populateOsAndOsVersion (browserstack-runner/lib/configParser.js)

Fixes #243.

When no match is found, the process would just crash. Instead, recognise
this as a normal end-user scenario and point them to the list of
available workers.

In my experience the most common way to encounter this issue is when
additional decimal places are required by the API, e.g. "safari"
"9" results in a crash, because the available workers are described
as "9.1" instead. Given that most browers are described without a
decimal place, this is an easy mistake to make.

Another way to get this is when there is a misspelled browser name.

Before:

```
TypeError: Cannot read property 'browser_version' of undefined
    at browserstack-runner/bin/cli.js
```

After:

```
Error: No desktop match found for {"browser":"safari","browser_version":"9"}
Check https://www.browserstack.com/list-of-browsers-and-platforms/js_testing
    at populateOsAndOsVersion (browserstack-runner/lib/configParser.js)

```

Fixes browserstack#243.
@francisf francisf merged commit 69982f7 into browserstack:master Apr 19, 2021
@Krinkle Krinkle deleted the patch-3 branch April 19, 2021 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeError: Cannot read property 'browser_version' of undefined
3 participants