Skip to content

fix: fix "Could not open file Library/Application Support/LiveSync/app/tns_modules/tns-core-modules/inspector_modules.js for writing" error on iOS device when hmr fails #4778

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 2 commits into from
Jun 28, 2019

Conversation

Fatme
Copy link
Contributor

@Fatme Fatme commented Jun 27, 2019

NativeScript CLI zips all files from application except the files from tns-modules. When the runtime unzips the uploaded archive on device, it symlinks the tns_modules folder from app's bundle folder. When hmr fails, CLI transfers fallback files on device in order to apply the change. The inspector_modules.js file is part of these fallback files which is located in tns_modules folder. In this situation CLI tries to write the file inside /Library/Application Support/LiveSync/app/tns_modules which is symlinked to app's bundle folder. As CLI is not able to write directly to app's bundle folder, the above error is thrown.

PR Checklist

What is the current behavior?

What is the new behavior?

Fixes/Implements/Closes #[Issue Number].

@cla-bot cla-bot bot added the cla: yes label Jun 27, 2019
…p/tns_modules/tns-core-modules/inspector_modules.js for writing" error on iOS device when hmr fails

NativeScript CLI zips all files from application except the files from tns-modules. When the runtime unzip the uploaded archive on device, it symlinks the tns_modules folder. When hmr fails, CLI transfers fallback files on device in order to apply the change. The `inspector_modules.js` file is part of these fallback files which is located in `tns_modules` folder. In this situation CLI tries to write the file inside /Library/Application Support/LiveSync/app/tns_modules which is symlinked to app's bundle folder. As CLI is not able to write directly to app's bundle folder, the above error is thrown.
@Fatme Fatme force-pushed the fatme/fix-hmr-fail-ios-device branch from 893bb33 to ecfe620 Compare June 27, 2019 11:12
@Fatme
Copy link
Contributor Author

Fatme commented Jun 27, 2019

test cli-device

Copy link
Contributor

@rosen-vladimirov rosen-vladimirov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can skip creation of temp folder and just zip the content of projectFilesPath

@Fatme
Copy link
Contributor Author

Fatme commented Jun 28, 2019

test cli-device

@Fatme Fatme merged commit f9766bd into master Jun 28, 2019
@Fatme Fatme deleted the fatme/fix-hmr-fail-ios-device branch June 28, 2019 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants