fix: Unable to run app on iOS in Sidekick #3685
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When trying to run application on iOS in Sidekick for the first time (when the iOS platform is not added yet to the project), the run fails with error "Cannot read property version of undefined".
The problem is in the call to
platformLiveSyncService.prepareForLiveSync
which tries to start parsing device logs before starting the liveSync action. However, at this point, the application does not have the platform added yet and the code that tries to get the version oftns-ios
from project's package.json fails. In order to resolve this, ensure the code for getting framework version from package.json will return undefined instead of failing.When undefined is returned, we know CLI will add the latest compatible iOS runtime version. We know that this version will print the port for debugging in the logs, so we can safely start parsing the logs.
PR Checklist