Skip to content

Commit 893bb33

Browse files
committed
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
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.
1 parent 98b14da commit 893bb33

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

lib/services/livesync/ios-livesync-service.ts

-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ export class IOSLiveSyncService extends PlatformLiveSyncServiceBase implements I
3434
this.$logger.trace("Creating zip file: " + tempZip);
3535
this.$fs.copyFile(path.join(path.dirname(projectFilesPath), `${APP_FOLDER_NAME}/*`), tempApp);
3636

37-
this.$fs.deleteDirectory(path.join(tempApp, TNS_MODULES_FOLDER_NAME));
38-
3937
await this.$fs.zipFiles(tempZip, this.$fs.enumerateFilesInDirectorySync(tempApp), (res) => {
4038
return path.join(APP_FOLDER_NAME, path.relative(tempApp, res));
4139
});

0 commit comments

Comments
 (0)