Skip to content

Commit 4b971de

Browse files
committed
fix: restore application when the broken xml file is fixed
The files on android device are transferred through socket. When the application is in errorActivity, the runtime reports to the CLI that the application is in broken state (e.g. didRefresh property). In this case NativeScript CLI transfers all fallback files (bundle.js and runtime.js). CLI has a logic to ignore all non-existing files when transferring them on the device. As the fallback files are reported with relative paths, CLI consider them as non-existing and doesn't transfer them on device. So in order to fix this issue, we need to make fallbackFiles with absolute paths. To reproduce: 1. tns run android 2. Broke some xml file from the application 3. Fix the broken xml file
1 parent ac38f16 commit 4b971de

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/services/webpack/webpack-compiler-service.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@ export class WebpackCompilerService extends EventEmitter implements IWebpackComp
4242

4343
const files = result.emittedFiles
4444
.map((file: string) => path.join(platformData.appDestinationDirectoryPath, "app", file));
45+
const fallbackFiles = result.fallbackFiles
46+
.map((file: string) => path.join(platformData.appDestinationDirectoryPath, "app", file));
4547

4648
const data = {
4749
files,
4850
hmrData: {
4951
hash: result.hash,
50-
fallbackFiles: result.fallbackFiles
52+
fallbackFiles
5153
}
5254
};
5355

0 commit comments

Comments
 (0)