-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
Livesync hangs when modifying App_Resources in before-prepare hook #3251
Comments
Hi, I have the same problem using NS 3.4. As I understand it, files under the App_Resources shouldn't be transferred when the application is not rebuilt, otherwise it crashs under iOS (at least when using the emulator) when refreshing the application. Regards. |
I manage to fix my plugin by unwatching localization files: if (liveSyncService &&
liveSyncService.liveSyncProcessesInfo[projectData.projectDir] &&
liveSyncService.liveSyncProcessesInfo[projectData.projectDir].watcherInfo &&
liveSyncService.liveSyncProcessesInfo[projectData.projectDir].watcherInfo.watcher
) {
const watcherInfo = liveSyncService.liveSyncProcessesInfo[projectData.projectDir].watcherInfo;
if (!watcherInfo._isLocalizePluginHackInstalledForPlatform) {
watcherInfo._isLocalizePluginHackInstalledForPlatform = {};
}
if (!watcherInfo._isLocalizePluginHackInstalledForPlatform[platformName]) {
converter.livesyncExclusionPatterns().forEach(pattern => {
watcherInfo.watcher.unwatch(path.relative(projectData.projectDir, pattern));
});
watcherInfo._isLocalizePluginHackInstalledForPlatform[platformName] = true;
}
} But that's a HACK, I'm not using the public API. Regards. |
Hi @lfabreges, Thank you for your detailed description and providing the workaround. You're absolutely correct about the reasons to have this issue. It is hard to reproduce but is a valid scenario. Also you're correct that build is mandatory when some change occurs in App_Resources folder. We're working on improving this behaviour and providing a fix. Your issue should be resolved, after implementing this feature #3404. |
Hi @Fatme, It wasn't working correctly, even with the #3404 feature. I now use the Regards. |
Tell us about the problem
When using nativescript-localize with "tns run ios", it tries to sync Localizable.strings without rebuilding the app.
Which platform(s) does your issue occur on?
iOS, haven't tried on Android
Please provide the following version numbers that your issue occurs with:
Please tell us how to recreate the issue in as much detail as possible.
Then make a change in the
app/i18n/en.default.js
file, change "Hello World !" to "Hello" for example.More
I think the problem occurs because :
I tried to hook into the process but did not find a way to fix it, I triggered a build by modifying appResourcesChanged directly into the plugin, it works but Localizable.strings is stilled synced afterwards, so it hangs again.
I'm the author of the plugin, so I can change it if needed. I definitly need some help on it.
Regards.
The text was updated successfully, but these errors were encountered: