From 3b7def6e5537289be4dc6d2a63ba764e47b8fcbf Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Mon, 17 Feb 2020 10:51:23 +0200 Subject: [PATCH 1/7] fix: external files are not livesynced In case you have external files set in the webpack.config.js (or resources copied with CopyWebpackPlugin), the `tns run ...` command does not LiveSync them to device. Webpack compilation is triggered, but as the emitted files are not hot updates, the hot update hash of the compilation is the same as the previous one. In this case CLI decides there's nothing to sync. To fix this extend the check in webpack-compiler-service to be based not only on the comparison between previous and current hash, but on the emitted files as well - if there are files which are not hot updates, continue the execution even if the previous and current hash are the same. That's exactly the case with externals. --- lib/services/webpack/webpack-compiler-service.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/services/webpack/webpack-compiler-service.ts b/lib/services/webpack/webpack-compiler-service.ts index 0b353499c8..3151f8d813 100644 --- a/lib/services/webpack/webpack-compiler-service.ts +++ b/lib/services/webpack/webpack-compiler-service.ts @@ -49,11 +49,8 @@ export class WebpackCompilerService extends EventEmitter implements IWebpackComp return; } - // the hash of the compilation is the same as the previous one - if (this.expectedHashes[platformData.platformNameLowerCase] === message.hash) { - return; - } - + // Persist the previousHash value before calling `this.getUpdatedEmittedFiles` as it will modify the expectedHashes object with the current hash + const previousHash = this.expectedHashes[platformData.platformNameLowerCase]; let result; if (prepareData.hmr) { @@ -78,6 +75,12 @@ export class WebpackCompilerService extends EventEmitter implements IWebpackComp }; this.$logger.trace("Generated data from webpack message:", data); + + // the hash of the compilation is the same as the previous one and there are only hot updates produced + if (data.hasOnlyHotUpdateFiles && previousHash === message.hash) { + return; + } + if (data.files.length) { this.emit(WEBPACK_COMPILATION_COMPLETE, data); } From b270f79ca9d56a4cf9aa23ef83fde916645729b6 Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Mon, 17 Feb 2020 12:45:03 +0200 Subject: [PATCH 2/7] chore: update version to 6.4.1 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index b86b4a63af..6c5d819382 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "nativescript", - "version": "6.4.0", + "version": "6.4.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d8c9135c4e..8dad9ce3ca 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nativescript", "preferGlobal": true, - "version": "6.4.0", + "version": "6.4.1", "author": "Telerik ", "description": "Command-line interface for building NativeScript projects", "bin": { From a9e1cf05317fa93684204773d26fa6531da42c1d Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Mon, 17 Feb 2020 12:47:02 +0200 Subject: [PATCH 3/7] release: cut 6.4.1 release --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba754c9ad8..f65a231091 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ NativeScript CLI Changelog ================ +6.4.1 (2020, February 19) +=== + +### Fixed + +* [Fixed #5251](https://github.com/NativeScript/nativescript-cli/issues/5251): External files are not livesynced + + 6.4.0 (2020, February 11) === From 938af819e6b136c8742f8982c23af6dec5b18a7c Mon Sep 17 00:00:00 2001 From: DimitarTachev Date: Fri, 14 Feb 2020 19:13:51 +0200 Subject: [PATCH 4/7] fix: support request cleanup + options for the commands --- .../cleanup-process-definitions.d.ts | 21 +++++++- lib/detached-processes/cleanup-process.ts | 50 ++++++++++++++++++- .../detached-process-enums.d.ts | 9 ++++ lib/services/cleanup-service.ts | 12 ++++- lib/services/ios-project-service.ts | 14 +++--- 5 files changed, 95 insertions(+), 11 deletions(-) diff --git a/lib/detached-processes/cleanup-process-definitions.d.ts b/lib/detached-processes/cleanup-process-definitions.d.ts index 24eab593a4..e4927f7c58 100644 --- a/lib/detached-processes/cleanup-process-definitions.d.ts +++ b/lib/detached-processes/cleanup-process-definitions.d.ts @@ -22,6 +22,18 @@ interface ISpawnCommandInfo extends ITimeout { * Arguments that will be passed to the child process */ args: string[]; + + /** + * Options to be passed to the child process + */ + options?: any; +} + +interface IRequestInfo extends ITimeout { + url: string, + method: string, + body: any, + headers: any } interface ICleanupMessageBase { @@ -38,6 +50,13 @@ interface ISpawnCommandCleanupMessage extends ICleanupMessageBase { commandInfo: ISpawnCommandInfo; } +interface IRequestCleanupMessage extends ICleanupMessageBase { + /** + * Describes the request that must be executed + */ + requestInfo: IRequestInfo; +} + interface IFileCleanupMessage extends ICleanupMessageBase, IFilePath { } interface IJSCommand extends ITimeout, IFilePath { @@ -46,4 +65,4 @@ interface IJSCommand extends ITimeout, IFilePath { interface IJSCleanupMessage extends ICleanupMessageBase { jsCommand: IJSCommand; - } +} diff --git a/lib/detached-processes/cleanup-process.ts b/lib/detached-processes/cleanup-process.ts index a6bd0c7975..1ddd41968b 100644 --- a/lib/detached-processes/cleanup-process.ts +++ b/lib/detached-processes/cleanup-process.ts @@ -20,6 +20,24 @@ fileLogService.logData({ message: "Initializing Cleanup process." }); const commandsInfos: ISpawnCommandInfo[] = []; const filesToDelete: string[] = []; const jsCommands: IJSCommand[] = []; +const requests: IRequestInfo[] = []; + +const executeRequest = async (request: IRequestInfo) => { + const $httpClient = $injector.resolve("httpClient"); + try { + fileLogService.logData({ message: `Start executing request: ${request.method} ${request.url}` }); + const response = await $httpClient.httpRequest({ + url: request.url, + method: request.method, + headers: request.headers, + body: request.body + }); + const responseStatus = response && response.response && response.response.statusCode; + fileLogService.logData({ message: `Finished executing request: ${request.method} ${request.url} and got status ${responseStatus}` }); + } catch (e) { + fileLogService.logData({ message: `Unable to execute request: ${request.method} ${request.url}` }); + } +}; const executeJSCleanup = async (jsCommand: IJSCommand) => { const $childProcess = $injector.resolve("childProcess"); @@ -28,7 +46,7 @@ const executeJSCleanup = async (jsCommand: IJSCommand) => { fileLogService.logData({ message: `Start executing action for file: ${jsCommand.filePath} and data ${JSON.stringify(jsCommand.data)}` }); await $childProcess.trySpawnFromCloseEvent(process.execPath, [path.join(__dirname, "cleanup-js-subprocess.js"), pathToBootstrap, logFile, jsCommand.filePath, JSON.stringify(jsCommand.data)], {}, { throwError: true, timeout: jsCommand.timeout || 3000 }); - fileLogService.logData({ message: `Finished xecuting action for file: ${jsCommand.filePath} and data ${JSON.stringify(jsCommand.data)}` }); + fileLogService.logData({ message: `Finished executing action for file: ${jsCommand.filePath} and data ${JSON.stringify(jsCommand.data)}` }); } catch (err) { fileLogService.logData({ message: `Unable to execute action for file ${jsCommand.filePath} with data ${JSON.stringify(jsCommand.data)}. Error is: ${err}.`, type: FileLogMessageType.Error }); @@ -38,6 +56,10 @@ const executeJSCleanup = async (jsCommand: IJSCommand) => { const executeCleanup = async () => { const $childProcess = $injector.resolve("childProcess"); + for (const request of requests) { + await executeRequest(request); + } + for (const jsCommand of jsCommands) { await executeJSCleanup(jsCommand); } @@ -46,7 +68,7 @@ const executeCleanup = async () => { try { fileLogService.logData({ message: `Start executing command: ${JSON.stringify(commandInfo)}` }); - await $childProcess.trySpawnFromCloseEvent(commandInfo.command, commandInfo.args, {}, { throwError: true, timeout: commandInfo.timeout || 3000 }); + await $childProcess.trySpawnFromCloseEvent(commandInfo.command, commandInfo.args, commandInfo.options || {}, { throwError: true, timeout: commandInfo.timeout || 3000 }); fileLogService.logData({ message: `Successfully executed command: ${JSON.stringify(commandInfo)}` }); } catch (err) { fileLogService.logData({ message: `Unable to execute command: ${JSON.stringify(commandInfo)}. Error is: ${err}.`, type: FileLogMessageType.Error }); @@ -84,6 +106,24 @@ const removeCleanupAction = (commandInfo: ISpawnCommandInfo): void => { } }; +const addRequest = (requestInfo: IRequestInfo): void => { + if (_.some(requests, currentRequestInfo => _.isEqual(currentRequestInfo, requestInfo))) { + fileLogService.logData({ message: `cleanup-process will not add request for execution as it has been added already: ${JSON.stringify(requestInfo)}` }); + } else { + fileLogService.logData({ message: `cleanup-process added request for execution: ${JSON.stringify(requestInfo)}` }); + requests.push(requestInfo); + } +}; + +const removeRequest = (requestInfo: IRequestInfo): void => { + if (_.some(requests, currentRequestInfo => _.isEqual(currentRequestInfo, currentRequestInfo))) { + _.remove(requests, currentRequestInfo => _.isEqual(currentRequestInfo, requestInfo)); + fileLogService.logData({ message: `cleanup-process removed request for execution: ${JSON.stringify(requestInfo)}` }); + } else { + fileLogService.logData({ message: `cleanup-process cannot remove request for execution as it has not been added before: ${JSON.stringify(requestInfo)}` }); + } +}; + const addDeleteAction = (filePath: string): void => { const fullPath = path.resolve(filePath); @@ -142,6 +182,12 @@ process.on("message", async (cleanupProcessMessage: ICleanupMessageBase) => { case CleanupProcessMessage.RemoveCleanCommand: removeCleanupAction((cleanupProcessMessage).commandInfo); break; + case CleanupProcessMessage.AddRequest: + addRequest((cleanupProcessMessage).requestInfo); + break; + case CleanupProcessMessage.RemoveRequest: + removeRequest((cleanupProcessMessage).requestInfo); + break; case CleanupProcessMessage.AddDeleteFileAction: addDeleteAction((cleanupProcessMessage).filePath); break; diff --git a/lib/detached-processes/detached-process-enums.d.ts b/lib/detached-processes/detached-process-enums.d.ts index 1c250b7cb9..98692f1568 100644 --- a/lib/detached-processes/detached-process-enums.d.ts +++ b/lib/detached-processes/detached-process-enums.d.ts @@ -38,6 +38,15 @@ declare const enum CleanupProcessMessage { * This type of message defines that cleanup procedure should not execute previously defined cleanup command. */ RemoveCleanCommand = "RemoveCleanCommand", + /** + * This type of message defines that cleanup procedure should execute specific request. + */ + AddRequest = "AddRequest", + + /** + * This type of message defines that cleanup procedure should not execute previously defined request. + */ + RemoveRequest = "RemoveRequest", /** * This type of message defines that cleanup procedure should delete specified files. diff --git a/lib/services/cleanup-service.ts b/lib/services/cleanup-service.ts index 723810bd0b..50351e21c5 100644 --- a/lib/services/cleanup-service.ts +++ b/lib/services/cleanup-service.ts @@ -25,6 +25,16 @@ export class CleanupService implements ICleanupService { cleanupProcess.send({ messageType: CleanupProcessMessage.RemoveCleanCommand, commandInfo }); } + public async addRequest(requestInfo: IRequestInfo): Promise { + const cleanupProcess = await this.getCleanupProcess(); + cleanupProcess.send({ messageType: CleanupProcessMessage.AddRequest, requestInfo }); + } + + public async removeRequest(requestInfo: IRequestInfo): Promise { + const cleanupProcess = await this.getCleanupProcess(); + cleanupProcess.send({ messageType: CleanupProcessMessage.RemoveRequest, requestInfo }); + } + public async addCleanupDeleteAction(filePath: string): Promise { const cleanupProcess = await this.getCleanupProcess(); cleanupProcess.send({ messageType: CleanupProcessMessage.AddDeleteFileAction, filePath }); @@ -42,7 +52,7 @@ export class CleanupService implements ICleanupService { public async removeCleanupJS(jsCommand: IJSCommand): Promise { const cleanupProcess = await this.getCleanupProcess(); - cleanupProcess.send({ messageType: CleanupProcessMessage.RemoveJSFileToRequire, jsCommand}); + cleanupProcess.send({ messageType: CleanupProcessMessage.RemoveJSFileToRequire, jsCommand }); } public async addKillProcess(pid: string): Promise { diff --git a/lib/services/ios-project-service.ts b/lib/services/ios-project-service.ts index ec146e5d4c..be80de7751 100644 --- a/lib/services/ios-project-service.ts +++ b/lib/services/ios-project-service.ts @@ -209,29 +209,29 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ } @hook('buildIOS') - public async buildProject(projectRoot: string, projectData: IProjectData, iOSBuildData: IOSBuildData): Promise { + public async buildProject(projectRoot: string, projectData: IProjectData, buildData: IOSBuildData): Promise { const platformData = this.getPlatformData(projectData); const handler = (data: any) => { this.emit(constants.BUILD_OUTPUT_EVENT_NAME, data); }; - if (iOSBuildData.buildForDevice) { - await this.$iOSSigningService.setupSigningForDevice(projectRoot, projectData, iOSBuildData); + if (buildData.buildForDevice) { + await this.$iOSSigningService.setupSigningForDevice(projectRoot, projectData, buildData); await attachAwaitDetach(constants.BUILD_OUTPUT_EVENT_NAME, this.$childProcess, handler, - this.$xcodebuildService.buildForDevice(platformData, projectData, iOSBuildData)); - } else if (iOSBuildData.buildForAppStore) { + this.$xcodebuildService.buildForDevice(platformData, projectData, buildData)); + } else if (buildData.buildForAppStore) { await attachAwaitDetach(constants.BUILD_OUTPUT_EVENT_NAME, this.$childProcess, handler, - this.$xcodebuildService.buildForAppStore(platformData, projectData, iOSBuildData)); + this.$xcodebuildService.buildForAppStore(platformData, projectData, buildData)); } else { await attachAwaitDetach(constants.BUILD_OUTPUT_EVENT_NAME, this.$childProcess, handler, - this.$xcodebuildService.buildForSimulator(platformData, projectData, iOSBuildData)); + this.$xcodebuildService.buildForSimulator(platformData, projectData, buildData)); } this.validateApplicationIdentifier(projectData); From a9b6083691d08706b4dee1e7a6b3bbe134a3afc1 Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Wed, 19 Feb 2020 13:03:12 +0200 Subject: [PATCH 5/7] fix: file paths shown for device logs should be clickable Currently CLI tries to persist the formating of logs as close as possible to the real logs coming from device. The logs from the applications contain `file:///`. CLI replaces the `` with the real local file path. However, due to the `file:///` prefix, the link is not clickable. For example, in case you use VSCode's terminal, you should be able to use Ctrl + Click on the link and this will lead you to the exact line where the stack trace points to. To resolve this issue, replace the `file:///` with just `file: `. --- .../unit-tests/mobile/device-log-provider.ts | 286 +++++++++--------- lib/services/log-source-map-service.ts | 5 +- test/services/log-source-map-service.ts | 14 +- 3 files changed, 153 insertions(+), 152 deletions(-) diff --git a/lib/common/test/unit-tests/mobile/device-log-provider.ts b/lib/common/test/unit-tests/mobile/device-log-provider.ts index e3a133330a..def5c9efb2 100644 --- a/lib/common/test/unit-tests/mobile/device-log-provider.ts +++ b/lib/common/test/unit-tests/mobile/device-log-provider.ts @@ -172,10 +172,10 @@ JS: console.log\n`); 08-22 15:32:03.145 25038 25038 E JS : at push.../node_modules/tns-core-modules/data/observable/observable.js.Observable._emit (file:///data/data/org.nativescript.appTestLogs/files/app/vendor.js:3724:18) 08-22 15:32:03.145 25038 25038 E JS : at ClickListenerImpl.onClick (file:///data/data/org.nativescript.appTestLogs/files/app/vendor.js:14608:23)`); assertData(logger.output, `JS: Trace: console.trace onTap -JS: at viewModel.onTap file:///app/main-view-model.js:39:0 -JS: at push.../node_modules/tns-core-modules/data/observable/observable.js.Observable.notify file:///node_modules/tns-core-modules/data/observable/observable.js:107:0 -JS: at push.../node_modules/tns-core-modules/data/observable/observable.js.Observable._emit file:///node_modules/tns-core-modules/data/observable/observable.js:127:0 -JS: at ClickListenerImpl.onClick file:///node_modules/tns-core-modules/ui/button/button.js:29:0\n`); +JS: at viewModel.onTap file: app/main-view-model.js:39:0 +JS: at push.../node_modules/tns-core-modules/data/observable/observable.js.Observable.notify file: node_modules/tns-core-modules/data/observable/observable.js:107:0 +JS: at push.../node_modules/tns-core-modules/data/observable/observable.js.Observable._emit file: node_modules/tns-core-modules/data/observable/observable.js:127:0 +JS: at ClickListenerImpl.onClick file: node_modules/tns-core-modules/ui/button/button.js:29:0\n`); }); it("console.time(timeEnd) statement", () => { @@ -240,10 +240,10 @@ System.err: Calling js method onClick failed System.err: Error: Error in onTap System.err: ` + ` System.err: StackTrace: -System.err: Frame: function:'viewModel.onTap', file:'file:///app/main-view-model.js:43:0 -System.err: Frame: function:'push.../node_modules/tns-core-modules/data/observable/observable.js.Observable.notify', file:'file:///node_modules/tns-core-modules/data/observable/observable.js:107:0 -System.err: Frame: function:'push.../node_modules/tns-core-modules/data/observable/observable.js.Observable._emit', file:'file:///node_modules/tns-core-modules/data/observable/observable.js:127:0 -System.err: Frame: function:'ClickListenerImpl.onClick', file:'file:///node_modules/tns-core-modules/ui/button/button.js:29:0 +System.err: Frame: function:'viewModel.onTap', file:'file: app/main-view-model.js:43:0 +System.err: Frame: function:'push.../node_modules/tns-core-modules/data/observable/observable.js.Observable.notify', file:'file: node_modules/tns-core-modules/data/observable/observable.js:107:0 +System.err: Frame: function:'push.../node_modules/tns-core-modules/data/observable/observable.js.Observable._emit', file:'file: node_modules/tns-core-modules/data/observable/observable.js:127:0 +System.err: Frame: function:'ClickListenerImpl.onClick', file:'file: node_modules/tns-core-modules/ui/button/button.js:29:0 System.err: at com.tns.Runtime.callJSMethodNative(Native Method) System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1242) System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:1122) @@ -325,10 +325,10 @@ JS: console.log\n`); 08-23 16:16:06.571 25038 25038 E JS : at push.../node_modules/tns-core-modules/data/observable/observable.js.Observable._emit (file:///data/data/org.nativescript.appTestLogs/files/app/vendor.js:3724:18) 08-23 16:16:06.571 25038 25038 E JS : at ClickListenerImpl.onClick (file:///data/data/org.nativescript.appTestLogs/files/app/vendor.js:14608:23)`); assertData(logger.output, `JS: Trace: console.trace onTap -JS: at viewModel.onTap (file:///app/main-view-model.js:39:0) -JS: at push.../node_modules/tns-core-modules/data/observable/observable.js.Observable.notify (file:///node_modules/tns-core-modules/data/observable/observable.js:107:0) -JS: at push.../node_modules/tns-core-modules/data/observable/observable.js.Observable._emit (file:///node_modules/tns-core-modules/data/observable/observable.js:127:0) -JS: at ClickListenerImpl.onClick (file:///node_modules/tns-core-modules/ui/button/button.js:29:0)\n`); +JS: at viewModel.onTap (file: app/main-view-model.js:39:0) +JS: at push.../node_modules/tns-core-modules/data/observable/observable.js.Observable.notify (file: node_modules/tns-core-modules/data/observable/observable.js:107:0) +JS: at push.../node_modules/tns-core-modules/data/observable/observable.js.Observable._emit (file: node_modules/tns-core-modules/data/observable/observable.js:127:0) +JS: at ClickListenerImpl.onClick (file: node_modules/tns-core-modules/ui/button/button.js:29:0)\n`); }); it("console.time(timeEnd) statement", () => { @@ -393,10 +393,10 @@ System.err: Calling js method onClick failed System.err: Error: Error in onTap System.err: ` + ` System.err: StackTrace: -System.err: viewModel.onTap(file:///app/main-view-model.js:43:0) -System.err: at push.../node_modules/tns-core-modules/data/observable/observable.js.Observable.notify(file:///node_modules/tns-core-modules/data/observable/observable.js:107:0) -System.err: at push.../node_modules/tns-core-modules/data/observable/observable.js.Observable._emit(file:///node_modules/tns-core-modules/data/observable/observable.js:127:0) -System.err: at ClickListenerImpl.onClick(file:///node_modules/tns-core-modules/ui/button/button.js:29:0) +System.err: viewModel.onTap(file: app/main-view-model.js:43:0) +System.err: at push.../node_modules/tns-core-modules/data/observable/observable.js.Observable.notify(file: node_modules/tns-core-modules/data/observable/observable.js:107:0) +System.err: at push.../node_modules/tns-core-modules/data/observable/observable.js.Observable._emit(file: node_modules/tns-core-modules/data/observable/observable.js:127:0) +System.err: at ClickListenerImpl.onClick(file: node_modules/tns-core-modules/ui/button/button.js:29:0) System.err: at com.tns.Runtime.callJSMethodNative(Native Method) System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1209) System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:1096) @@ -441,7 +441,7 @@ System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)\n`) it("console.log", () => { logDataForiOS("Aug 23 14:38:54 mcsofvladimirov appTestLogs[8455]: CONSOLE INFO file:///app/vendor.js:168:36: HMR: Hot Module Replacement Enabled. Waiting for signal."); - assertData(logger.output, "CONSOLE INFO file:///node_modules/nativescript-dev-webpack/hot.js:3:0 HMR: Hot Module Replacement Enabled. Waiting for signal.\n"); + assertData(logger.output, "CONSOLE INFO file: node_modules/nativescript-dev-webpack/hot.js:3:0 HMR: Hot Module Replacement Enabled. Waiting for signal.\n"); }); it("console.dir", () => { @@ -459,7 +459,7 @@ System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)\n`) "level1_0": "value3" } ==== object dump end ====`); - assertData(logger.output, `CONSOLE LOG file:///app/main-view-model.js:20:0 + assertData(logger.output, `CONSOLE LOG file: app/main-view-model.js:20:0 ==== object dump start ==== level0_0: { "level1_0": { @@ -480,7 +480,7 @@ level0_1: { message from console.log`); - assertData(logger.output, `CONSOLE LOG file:///app/main-view-model.js:34:0 multiline + assertData(logger.output, `CONSOLE LOG file: app/main-view-model.js:34:0 multiline message from console.log\n`); @@ -504,19 +504,19 @@ console.log\n`); 14 evaluate@[native code] 15 moduleEvaluation@:1:11 16 promiseReactionJob@:1:11`); - assertData(logger.output, `CONSOLE TRACE file:///app/main-view-model.js:39:0 console.trace onTap -1 onTap@file:///app/main-view-model.js:39:0 -2 notify@file:///node_modules/tns-core-modules/data/observable/observable.js:107:0 -3 _emit@file:///node_modules/tns-core-modules/data/observable/observable.js:127:0 -4 tap@file:///node_modules/tns-core-modules/ui/button/button.js:216:0 + assertData(logger.output, `CONSOLE TRACE file: app/main-view-model.js:39:0 console.trace onTap +1 onTap@file: app/main-view-model.js:39:0 +2 notify@file: node_modules/tns-core-modules/data/observable/observable.js:107:0 +3 _emit@file: node_modules/tns-core-modules/data/observable/observable.js:127:0 +4 tap@file: node_modules/tns-core-modules/ui/button/button.js:216:0 5 UIApplicationMain@[native code] -6 _start@file:///node_modules/tns-core-modules/application/application.js:277:0 -7 run@file:///node_modules/tns-core-modules/application/application.js:305:0 -8 @file:///app/app.js:46:0 +6 _start@file: node_modules/tns-core-modules/application/application.js:277:0 +7 run@file: node_modules/tns-core-modules/application/application.js:305:0 +8 @file: app/app.js:46:0 9 ./app.js@file:///app/bundle.js:172:34 -10 __webpack_require__@file:///app/webpack/bootstrap:750:0 -11 checkDeferredModules@file:///app/webpack/bootstrap:43:0 -12 webpackJsonpCallback@file:///app/webpack/bootstrap:30:0 +10 __webpack_require__@file: app/webpack/bootstrap:750:0 +11 checkDeferredModules@file: app/webpack/bootstrap:43:0 +12 webpackJsonpCallback@file: app/webpack/bootstrap:30:0 13 anonymous@file:///app/bundle.js:2:61 14 evaluate@[native code] 15 moduleEvaluation@:1:11 @@ -633,24 +633,24 @@ Native stack trace: 18 0x10240863d ffi_call_unix64 19 0x10fc91100 JavaScript stack trace: -1 onTap@file:///app/main-view-model.js:43:0 -2 notify@file:///node_modules/tns-core-modules/data/observable/observable.js:107:0 -3 _emit@file:///node_modules/tns-core-modules/data/observable/observable.js:127:0 -4 tap@file:///node_modules/tns-core-modules/ui/button/button.js:216:0 +1 onTap@file: app/main-view-model.js:43:0 +2 notify@file: node_modules/tns-core-modules/data/observable/observable.js:107:0 +3 _emit@file: node_modules/tns-core-modules/data/observable/observable.js:127:0 +4 tap@file: node_modules/tns-core-modules/ui/button/button.js:216:0 5 UIApplicationMain@[native code] -6 _start@file:///node_modules/tns-core-modules/application/application.js:277:0 -7 run@file:///node_modules/tns-core-modules/application/application.js:305:0 -8 @file:///app/app.js:46:0 +6 _start@file: node_modules/tns-core-modules/application/application.js:277:0 +7 run@file: node_modules/tns-core-modules/application/application.js:305:0 +8 @file: app/app.js:46:0 9 ./app.js@file:///app/bundle.js:172:34 -10 __webpack_require__@file:///app/webpack/bootstrap:750:0 -11 checkDeferredModules@file:///app/webpack/bootstrap:43:0 -12 webpackJsonpCallback@file:///app/webpack/bootstrap:30:0 +10 __webpack_require__@file: app/webpack/bootstrap:750:0 +11 checkDeferredModules@file: app/webpack/bootstrap:43:0 +12 webpackJsonpCallback@file: app/webpack/bootstrap:30:0 13 anonymous@file:///app/bundle.js:2:61 14 evaluate@[native code] 15 moduleEvaluation@[native code] 16 promiseReactionJob@[native code] JavaScript error: -file:///app/main-view-model.js:43:0 JS ERROR Error: Error in onTap +file: app/main-view-model.js:43:0 JS ERROR Error: Error in onTap NativeScript caught signal 11. Native Stack: 1 0x101a7384f sig_handler(int) @@ -681,13 +681,13 @@ Native Stack: 26 0x10fc91100 JS Stack: 1 UIApplicationMain@[native code] -2 _start@file:///node_modules/tns-core-modules/application/application.js:277:0 -3 run@file:///node_modules/tns-core-modules/application/application.js:305:0 -4 @file:///app/app.js:46:0 +2 _start@file: node_modules/tns-core-modules/application/application.js:277:0 +3 run@file: node_modules/tns-core-modules/application/application.js:305:0 +4 @file: app/app.js:46:0 5 ./app.js@file:///app/bundle.js:172:34 -6 __webpack_require__@file:///app/webpack/bootstrap:750:0 -7 checkDeferredModules@file:///app/webpack/bootstrap:43:0 -8 webpackJsonpCallback@file:///app/webpack/bootstrap:30:0 +6 __webpack_require__@file: app/webpack/bootstrap:750:0 +7 checkDeferredModules@file: app/webpack/bootstrap:43:0 +8 webpackJsonpCallback@file: app/webpack/bootstrap:30:0 9 anonymous@file:///app/bundle.js:2:61 10 evaluate@[native code] 11 moduleEvaluation@:1:11 @@ -701,7 +701,7 @@ JS Stack: it("console.log", () => { logDataForiOS("2019-08-22 18:21:24.066975+0300 localhost appTestLogs[55619]: (NativeScript) CONSOLE INFO file:///app/vendor.js:168:36: HMR: Hot Module Replacement Enabled. Waiting for signal."); - assertData(logger.output, "CONSOLE INFO file:///node_modules/nativescript-dev-webpack/hot.js:3:0 HMR: Hot Module Replacement Enabled. Waiting for signal.\n"); + assertData(logger.output, "CONSOLE INFO file: node_modules/nativescript-dev-webpack/hot.js:3:0 HMR: Hot Module Replacement Enabled. Waiting for signal.\n"); }); it("console.dir", () => { @@ -719,7 +719,7 @@ level0_1: { "level1_0": "value3" } ==== object dump end ====`); - assertData(logger.output, `CONSOLE LOG file:///app/main-view-model.js:20:0 + assertData(logger.output, `CONSOLE LOG file: app/main-view-model.js:20:0 ==== object dump start ==== level0_0: { "level1_0": { @@ -740,7 +740,7 @@ level0_1: { message from console.log`); - assertData(logger.output, `CONSOLE LOG file:///app/main-view-model.js:34:0 multiline + assertData(logger.output, `CONSOLE LOG file: app/main-view-model.js:34:0 multiline message from console.log\n`); @@ -764,19 +764,19 @@ console.log\n`); 14 evaluate@[native code] 15 moduleEvaluation@:1:11 16 promiseReactionJob@:1:11`); - assertData(logger.output, `CONSOLE TRACE file:///app/main-view-model.js:39:0 console.trace onTap -1 onTap@file:///app/main-view-model.js:39:0 -2 notify@file:///node_modules/tns-core-modules/data/observable/observable.js:107:0 -3 _emit@file:///node_modules/tns-core-modules/data/observable/observable.js:127:0 -4 tap@file:///node_modules/tns-core-modules/ui/button/button.js:216:0 + assertData(logger.output, `CONSOLE TRACE file: app/main-view-model.js:39:0 console.trace onTap +1 onTap@file: app/main-view-model.js:39:0 +2 notify@file: node_modules/tns-core-modules/data/observable/observable.js:107:0 +3 _emit@file: node_modules/tns-core-modules/data/observable/observable.js:127:0 +4 tap@file: node_modules/tns-core-modules/ui/button/button.js:216:0 5 UIApplicationMain@[native code] -6 _start@file:///node_modules/tns-core-modules/application/application.js:277:0 -7 run@file:///node_modules/tns-core-modules/application/application.js:305:0 -8 @file:///app/app.js:46:0 +6 _start@file: node_modules/tns-core-modules/application/application.js:277:0 +7 run@file: node_modules/tns-core-modules/application/application.js:305:0 +8 @file: app/app.js:46:0 9 ./app.js@file:///app/bundle.js:172:34 -10 __webpack_require__@file:///app/webpack/bootstrap:750:0 -11 checkDeferredModules@file:///app/webpack/bootstrap:43:0 -12 webpackJsonpCallback@file:///app/webpack/bootstrap:30:0 +10 __webpack_require__@file: app/webpack/bootstrap:750:0 +11 checkDeferredModules@file: app/webpack/bootstrap:43:0 +12 webpackJsonpCallback@file: app/webpack/bootstrap:30:0 13 anonymous@file:///app/bundle.js:2:61 14 evaluate@[native code] 15 moduleEvaluation@:1:11 @@ -785,7 +785,7 @@ console.log\n`); it("console.time(timeEnd) statement", () => { logDataForiOS(`2019-08-22 18:21:26.133972+0300 localhost appTestLogs[55619]: (NativeScript) file:///app/bundle.js:291:24: CONSOLE INFO console.time: 1988.737ms`); - assertData(logger.output, "file:///app/main-view-model.js:41:0 CONSOLE INFO console.time: 1988.737ms\n"); + assertData(logger.output, "file: app/main-view-model.js:41:0 CONSOLE INFO console.time: 1988.737ms\n"); }); it("when an error is thrown, correct callstack is printed", async () => { @@ -898,24 +898,24 @@ Native stack trace: 19 0x10d1fe63d ffi_call_unix64 20 0x123da2c60 JavaScript stack trace: -1 onTap@file:///app/main-view-model.js:43:0 -2 notify@file:///node_modules/tns-core-modules/data/observable/observable.js:107:0 -3 _emit@file:///node_modules/tns-core-modules/data/observable/observable.js:127:0 -4 tap@file:///node_modules/tns-core-modules/ui/button/button.js:216:0 +1 onTap@file: app/main-view-model.js:43:0 +2 notify@file: node_modules/tns-core-modules/data/observable/observable.js:107:0 +3 _emit@file: node_modules/tns-core-modules/data/observable/observable.js:127:0 +4 tap@file: node_modules/tns-core-modules/ui/button/button.js:216:0 5 UIApplicationMain@[native code] -6 _start@file:///node_modules/tns-core-modules/application/application.js:277:0 -7 run@file:///node_modules/tns-core-modules/application/application.js:305:0 -8 @file:///app/app.js:46:0 +6 _start@file: node_modules/tns-core-modules/application/application.js:277:0 +7 run@file: node_modules/tns-core-modules/application/application.js:305:0 +8 @file: app/app.js:46:0 9 ./app.js@file:///app/bundle.js:172:34 -10 __webpack_require__@file:///app/webpack/bootstrap:750:0 -11 checkDeferredModules@file:///app/webpack/bootstrap:43:0 -12 webpackJsonpCallback@file:///app/webpack/bootstrap:30:0 +10 __webpack_require__@file: app/webpack/bootstrap:750:0 +11 checkDeferredModules@file: app/webpack/bootstrap:43:0 +12 webpackJsonpCallback@file: app/webpack/bootstrap:30:0 13 anonymous@file:///app/bundle.js:2:61 14 evaluate@[native code] 15 moduleEvaluation@[native code] 16 promiseReactionJob@[native code] JavaScript error: -file:///app/main-view-model.js:43:0 JS ERROR Error: Error in onTap +file: app/main-view-model.js:43:0 JS ERROR Error: Error in onTap NativeScript caught signal 11. Native Stack: 1 0x10c86984f sig_handler(int) @@ -947,13 +947,13 @@ Native Stack: 27 0x123da2c60 JS Stack: 1 UIApplicationMain@[native code] -2 _start@file:///node_modules/tns-core-modules/application/application.js:277:0 -3 run@file:///node_modules/tns-core-modules/application/application.js:305:0 -4 @file:///app/app.js:46:0 +2 _start@file: node_modules/tns-core-modules/application/application.js:277:0 +3 run@file: node_modules/tns-core-modules/application/application.js:305:0 +4 @file: app/app.js:46:0 5 ./app.js@file:///app/bundle.js:172:34 -6 __webpack_require__@file:///app/webpack/bootstrap:750:0 -7 checkDeferredModules@file:///app/webpack/bootstrap:43:0 -8 webpackJsonpCallback@file:///app/webpack/bootstrap:30:0 +6 __webpack_require__@file: app/webpack/bootstrap:750:0 +7 checkDeferredModules@file: app/webpack/bootstrap:43:0 +8 webpackJsonpCallback@file: app/webpack/bootstrap:30:0 9 anonymous@file:///app/bundle.js:2:61 10 evaluate@[native code] 11 moduleEvaluation@:1:11 @@ -975,7 +975,7 @@ JS Stack: it("console.log", () => { logDataForiOS("Aug 23 18:12:39 mcsofvladimirov appTestLogs[29554]: (NativeScript) CONSOLE INFO file:///app/vendor.js:168:36: HMR: Hot Module Replacement Enabled. Waiting for signal."); - assertData(logger.output, "CONSOLE INFO file:///node_modules/nativescript-dev-webpack/hot.js:3:0: HMR: Hot Module Replacement Enabled. Waiting for signal.\n"); + assertData(logger.output, "CONSOLE INFO file: node_modules/nativescript-dev-webpack/hot.js:3:0: HMR: Hot Module Replacement Enabled. Waiting for signal.\n"); }); it("console.dir", () => { @@ -993,7 +993,7 @@ JS Stack: "level1_0": "value3" } ==== object dump end ====`); - assertData(logger.output, `CONSOLE LOG file:///app/main-view-model.js:20:0: + assertData(logger.output, `CONSOLE LOG file: app/main-view-model.js:20:0: ==== object dump start ==== level0_0: { "level1_0": { @@ -1014,7 +1014,7 @@ level0_1: { message from console.log`); - assertData(logger.output, `CONSOLE LOG file:///app/main-view-model.js:34:0: multiline + assertData(logger.output, `CONSOLE LOG file: app/main-view-model.js:34:0: multiline message from console.log\n`); @@ -1038,19 +1038,19 @@ console.log\n`); at evaluate([native code]) at moduleEvaluation at promiseReactionJob`); - assertData(logger.output, `CONSOLE TRACE file:///app/main-view-model.js:39:0: console.trace onTap -onTap(file:///app/main-view-model.js:39:0) -at notify(file:///node_modules/tns-core-modules/data/observable/observable.js:107:0) -at _emit(file:///node_modules/tns-core-modules/data/observable/observable.js:127:0) -at tap(file:///node_modules/tns-core-modules/ui/button/button.js:216:0) + assertData(logger.output, `CONSOLE TRACE file: app/main-view-model.js:39:0: console.trace onTap +onTap(file: app/main-view-model.js:39:0) +at notify(file: node_modules/tns-core-modules/data/observable/observable.js:107:0) +at _emit(file: node_modules/tns-core-modules/data/observable/observable.js:127:0) +at tap(file: node_modules/tns-core-modules/ui/button/button.js:216:0) at UIApplicationMain([native code]) -at _start(file:///node_modules/tns-core-modules/application/application.js:277:0) -at run(file:///node_modules/tns-core-modules/application/application.js:305:0) -at file:///app/app.js:46:0 +at _start(file: node_modules/tns-core-modules/application/application.js:277:0) +at run(file: node_modules/tns-core-modules/application/application.js:305:0) +at file: app/app.js:46:0 at ./app.js(file:///app/bundle.js:172:34) -at __webpack_require__(file:///app/webpack/bootstrap:750:0) -at checkDeferredModules(file:///app/webpack/bootstrap:43:0) -at webpackJsonpCallback(file:///app/webpack/bootstrap:30:0) +at __webpack_require__(file: app/webpack/bootstrap:750:0) +at checkDeferredModules(file: app/webpack/bootstrap:43:0) +at webpackJsonpCallback(file: app/webpack/bootstrap:30:0) at anonymous(file:///app/bundle.js:2:61) at evaluate([native code]) at moduleEvaluation @@ -1059,7 +1059,7 @@ at promiseReactionJob\n`); it("console.time(timeEnd) statement", () => { logDataForiOS(`Aug 23 18:12:39 mcsofvladimirov appTestLogs[29554]: file:///app/bundle.js:291:24: CONSOLE INFO console.time: 27523.877ms`); - assertData(logger.output, "file:///app/main-view-model.js:41:0: CONSOLE INFO console.time: 27523.877ms\n"); + assertData(logger.output, "file: app/main-view-model.js:41:0: CONSOLE INFO console.time: 27523.877ms\n"); }); it("when an error is thrown, correct callstack is printed", async () => { @@ -1167,24 +1167,24 @@ Native stack trace: 18 0x10502d20d ffi_call_unix64 19 0x11085f1e0 JavaScript stack trace: -onTap(file:///app/main-view-model.js:43:0) -at notify(file:///node_modules/tns-core-modules/data/observable/observable.js:107:0) -at _emit(file:///node_modules/tns-core-modules/data/observable/observable.js:127:0) -at tap(file:///node_modules/tns-core-modules/ui/button/button.js:216:0) +onTap(file: app/main-view-model.js:43:0) +at notify(file: node_modules/tns-core-modules/data/observable/observable.js:107:0) +at _emit(file: node_modules/tns-core-modules/data/observable/observable.js:127:0) +at tap(file: node_modules/tns-core-modules/ui/button/button.js:216:0) at UIApplicationMain([native code]) -at _start(file:///node_modules/tns-core-modules/application/application.js:277:0) -at run(file:///node_modules/tns-core-modules/application/application.js:305:0) -at file:///app/app.js:46:0 +at _start(file: node_modules/tns-core-modules/application/application.js:277:0) +at run(file: node_modules/tns-core-modules/application/application.js:305:0) +at file: app/app.js:46:0 at ./app.js(file:///app/bundle.js:172:34) -at __webpack_require__(file:///app/webpack/bootstrap:750:0) -at checkDeferredModules(file:///app/webpack/bootstrap:43:0) -at webpackJsonpCallback(file:///app/webpack/bootstrap:30:0) +at __webpack_require__(file: app/webpack/bootstrap:750:0) +at checkDeferredModules(file: app/webpack/bootstrap:43:0) +at webpackJsonpCallback(file: app/webpack/bootstrap:30:0) at anonymous(file:///app/bundle.js:2:61) at evaluate([native code]) at moduleEvaluation([native code]) at promiseReactionJob([native code]) JavaScript error: -file:///app/main-view-model.js:43:0: JS ERROR Error: Error in onTap +file: app/main-view-model.js:43:0: JS ERROR Error: Error in onTap NativeScript caught signal 11. Native Stack: 1 0x1046941df sig_handler(int) @@ -1215,13 +1215,13 @@ Native Stack: 26 0x11085f1e0 JS Stack: UIApplicationMain([native code]) -at _start(file:///node_modules/tns-core-modules/application/application.js:277:0) -at run(file:///node_modules/tns-core-modules/application/application.js:305:0) -at file:///app/app.js:46:0 +at _start(file: node_modules/tns-core-modules/application/application.js:277:0) +at run(file: node_modules/tns-core-modules/application/application.js:305:0) +at file: app/app.js:46:0 at ./app.js(file:///app/bundle.js:172:34) -at __webpack_require__(file:///app/webpack/bootstrap:750:0) -at checkDeferredModules(file:///app/webpack/bootstrap:43:0) -at webpackJsonpCallback(file:///app/webpack/bootstrap:30:0) +at __webpack_require__(file: app/webpack/bootstrap:750:0) +at checkDeferredModules(file: app/webpack/bootstrap:43:0) +at webpackJsonpCallback(file: app/webpack/bootstrap:30:0) at anonymous(file:///app/bundle.js:2:61) at evaluate([native code]) at moduleEvaluation @@ -1235,7 +1235,7 @@ at promiseReactionJob\n`); it("console.log", () => { logDataForiOS("2019-08-23 17:08:38.860441+0300 localhost appTestLogs[21053]: (NativeScript) CONSOLE INFO file:///app/vendor.js:168:36: HMR: Hot Module Replacement Enabled. Waiting for signal."); - assertData(logger.output, "CONSOLE INFO file:///node_modules/nativescript-dev-webpack/hot.js:3:0: HMR: Hot Module Replacement Enabled. Waiting for signal.\n"); + assertData(logger.output, "CONSOLE INFO file: node_modules/nativescript-dev-webpack/hot.js:3:0: HMR: Hot Module Replacement Enabled. Waiting for signal.\n"); }); it("console.dir", () => { @@ -1253,7 +1253,7 @@ level0_1: { "level1_0": "value3" } ==== object dump end ====`); - assertData(logger.output, `CONSOLE LOG file:///app/main-view-model.js:20:0: + assertData(logger.output, `CONSOLE LOG file: app/main-view-model.js:20:0: ==== object dump start ==== level0_0: { "level1_0": { @@ -1274,7 +1274,7 @@ level0_1: { message from console.log`); - assertData(logger.output, `CONSOLE LOG file:///app/main-view-model.js:34:0: multiline + assertData(logger.output, `CONSOLE LOG file: app/main-view-model.js:34:0: multiline message from console.log\n`); @@ -1298,19 +1298,19 @@ at anonymous(file:///app/bundle.js:2:61) at evaluate([native code]) at moduleEvaluation at promiseReactionJob`); - assertData(logger.output, `CONSOLE TRACE file:///app/main-view-model.js:39:0: console.trace onTap -onTap(file:///app/main-view-model.js:39:0) -at notify(file:///node_modules/tns-core-modules/data/observable/observable.js:107:0) -at _emit(file:///node_modules/tns-core-modules/data/observable/observable.js:127:0) -at tap(file:///node_modules/tns-core-modules/ui/button/button.js:216:0) + assertData(logger.output, `CONSOLE TRACE file: app/main-view-model.js:39:0: console.trace onTap +onTap(file: app/main-view-model.js:39:0) +at notify(file: node_modules/tns-core-modules/data/observable/observable.js:107:0) +at _emit(file: node_modules/tns-core-modules/data/observable/observable.js:127:0) +at tap(file: node_modules/tns-core-modules/ui/button/button.js:216:0) at UIApplicationMain([native code]) -at _start(file:///node_modules/tns-core-modules/application/application.js:277:0) -at run(file:///node_modules/tns-core-modules/application/application.js:305:0) -at file:///app/app.js:46:0 +at _start(file: node_modules/tns-core-modules/application/application.js:277:0) +at run(file: node_modules/tns-core-modules/application/application.js:305:0) +at file: app/app.js:46:0 at ./app.js(file:///app/bundle.js:172:34) -at __webpack_require__(file:///app/webpack/bootstrap:750:0) -at checkDeferredModules(file:///app/webpack/bootstrap:43:0) -at webpackJsonpCallback(file:///app/webpack/bootstrap:30:0) +at __webpack_require__(file: app/webpack/bootstrap:750:0) +at checkDeferredModules(file: app/webpack/bootstrap:43:0) +at webpackJsonpCallback(file: app/webpack/bootstrap:30:0) at anonymous(file:///app/bundle.js:2:61) at evaluate([native code]) at moduleEvaluation @@ -1319,7 +1319,7 @@ at promiseReactionJob\n`); it("console.time(timeEnd) statement", () => { logDataForiOS(`2019-08-23 17:08:45.219341+0300 localhost appTestLogs[21053]: (NativeScript) file:///app/bundle.js:291:24: CONSOLE INFO console.time: 6285.199ms`); - assertData(logger.output, "file:///app/main-view-model.js:41:0: CONSOLE INFO console.time: 6285.199ms\n"); + assertData(logger.output, "file: app/main-view-model.js:41:0: CONSOLE INFO console.time: 6285.199ms\n"); }); it("when an error is thrown, correct callstack is printed", async () => { @@ -1431,24 +1431,24 @@ Native stack trace: 19 0x10bb6d20d ffi_call_unix64 20 0x12278db10 JavaScript stack trace: -onTap(file:///app/main-view-model.js:43:0) -at notify(file:///node_modules/tns-core-modules/data/observable/observable.js:107:0) -at _emit(file:///node_modules/tns-core-modules/data/observable/observable.js:127:0) -at tap(file:///node_modules/tns-core-modules/ui/button/button.js:216:0) +onTap(file: app/main-view-model.js:43:0) +at notify(file: node_modules/tns-core-modules/data/observable/observable.js:107:0) +at _emit(file: node_modules/tns-core-modules/data/observable/observable.js:127:0) +at tap(file: node_modules/tns-core-modules/ui/button/button.js:216:0) at UIApplicationMain([native code]) -at _start(file:///node_modules/tns-core-modules/application/application.js:277:0) -at run(file:///node_modules/tns-core-modules/application/application.js:305:0) -at file:///app/app.js:46:0 +at _start(file: node_modules/tns-core-modules/application/application.js:277:0) +at run(file: node_modules/tns-core-modules/application/application.js:305:0) +at file: app/app.js:46:0 at ./app.js(file:///app/bundle.js:172:34) -at __webpack_require__(file:///app/webpack/bootstrap:750:0) -at checkDeferredModules(file:///app/webpack/bootstrap:43:0) -at webpackJsonpCallback(file:///app/webpack/bootstrap:30:0) +at __webpack_require__(file: app/webpack/bootstrap:750:0) +at checkDeferredModules(file: app/webpack/bootstrap:43:0) +at webpackJsonpCallback(file: app/webpack/bootstrap:30:0) at anonymous(file:///app/bundle.js:2:61) at evaluate([native code]) at moduleEvaluation([native code]) at promiseReactionJob([native code]) JavaScript error: -file:///app/main-view-model.js:43:0: JS ERROR Error: Error in onTap +file: app/main-view-model.js:43:0: JS ERROR Error: Error in onTap NativeScript caught signal 11. Native Stack: 1 0x10b1d41df sig_handler(int) @@ -1480,13 +1480,13 @@ Native Stack: 27 0x12278db10 JS Stack: UIApplicationMain([native code]) -at _start(file:///node_modules/tns-core-modules/application/application.js:277:0) -at run(file:///node_modules/tns-core-modules/application/application.js:305:0) -at file:///app/app.js:46:0 +at _start(file: node_modules/tns-core-modules/application/application.js:277:0) +at run(file: node_modules/tns-core-modules/application/application.js:305:0) +at file: app/app.js:46:0 at ./app.js(file:///app/bundle.js:172:34) -at __webpack_require__(file:///app/webpack/bootstrap:750:0) -at checkDeferredModules(file:///app/webpack/bootstrap:43:0) -at webpackJsonpCallback(file:///app/webpack/bootstrap:30:0) +at __webpack_require__(file: app/webpack/bootstrap:750:0) +at checkDeferredModules(file: app/webpack/bootstrap:43:0) +at webpackJsonpCallback(file: app/webpack/bootstrap:30:0) at anonymous(file:///app/bundle.js:2:61) at evaluate([native code]) at moduleEvaluation diff --git a/lib/services/log-source-map-service.ts b/lib/services/log-source-map-service.ts index 88649a04c1..db8a8568f4 100644 --- a/lib/services/log-source-map-service.ts +++ b/lib/services/log-source-map-service.ts @@ -22,6 +22,7 @@ interface IFileLocation { export class LogSourceMapService implements Mobile.ILogSourceMapService { private static FILE_PREFIX = "file:///"; + private static FILE_PREFIX_REPLACEMENT = "file: "; private static MEMOIZE_FUNCTION_RANDOM_KEY_FOR_JOIN = "__some_random_value__"; private getProjectData: (projectDir: string) => IProjectData; private getRuntimeVersion: (projectDir: string, platform: string) => string; @@ -81,9 +82,9 @@ export class LogSourceMapService implements Mobile.ILogSourceMapService { const lastIndexOfFile = rawLine.lastIndexOf(LogSourceMapService.FILE_PREFIX); const firstPart = rawLine.substr(0, lastIndexOfFile); - outputData += firstPart + rawLine.substr(lastIndexOfFile).replace(/file:\/\/\/.+?:\d+:\d+/, `${LogSourceMapService.FILE_PREFIX}${sourceFile}:${line}:${column}`) + '\n'; + outputData += firstPart + rawLine.substr(lastIndexOfFile).replace(/file:\/\/\/.+?:\d+:\d+/, `${LogSourceMapService.FILE_PREFIX_REPLACEMENT}${sourceFile}:${line}:${column}`) + '\n'; } else { - outputData = `${outputData}${parsedLine.messagePrefix}${LogSourceMapService.FILE_PREFIX}${sourceFile}:${line}:${column}${parsedLine.messageSuffix}\n`; + outputData = `${outputData}${parsedLine.messagePrefix}${LogSourceMapService.FILE_PREFIX_REPLACEMENT}${sourceFile}:${line}:${column}${parsedLine.messageSuffix}\n`; } } else if (rawLine !== "") { outputData = `${outputData}${rawLine}\n`; diff --git a/test/services/log-source-map-service.ts b/test/services/log-source-map-service.ts index 282b16e35d..f89697f543 100644 --- a/test/services/log-source-map-service.ts +++ b/test/services/log-source-map-service.ts @@ -53,12 +53,12 @@ const testCases: IDictionary Date: Wed, 19 Feb 2020 13:07:18 +0200 Subject: [PATCH 6/7] fix: paths to platform specific files are not correct in logs When CLI parses the device logs, it tries to replace the file location with the real file path location. However, this does not work for platform specific files (in non-Angular projects) as we are using a virtual file system in webpack, which "lies" the file `button.js` exists, while in fact the file is `button..js`. So in the source maps, the location of the file is `button.js`. To resolve this, check if there's a platform specific file and use it instead. Cache the original file location, so we'll not execute multiple file operations for the same file. --- lib/services/log-source-map-service.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/services/log-source-map-service.ts b/lib/services/log-source-map-service.ts index db8a8568f4..aabd8b25a3 100644 --- a/lib/services/log-source-map-service.ts +++ b/lib/services/log-source-map-service.ts @@ -27,6 +27,7 @@ export class LogSourceMapService implements Mobile.ILogSourceMapService { private getProjectData: (projectDir: string) => IProjectData; private getRuntimeVersion: (projectDir: string, platform: string) => string; private cache: IDictionary = {}; + private originalFilesLocationCache: IStringDictionary = {}; private get $platformsDataService(): IPlatformsDataService { return this.$injector.resolve("platformsDataService"); @@ -123,7 +124,18 @@ export class LogSourceMapService implements Mobile.ILogSourceMapService { } sourceFile = stringReplaceAll(sourceFile, "/", path.sep); - return { sourceFile, line: originalPosition.line, column: originalPosition.column }; + if (!this.originalFilesLocationCache[sourceFile]) { + const { dir, ext, name } = path.parse(sourceFile); + const platformSpecificName = `${name}.${platform.toLowerCase()}`; + const platformSpecificFile = path.format({ dir, ext, name: platformSpecificName }); + if (this.$fs.exists(platformSpecificFile)) { + this.originalFilesLocationCache[sourceFile] = platformSpecificFile; + } else { + this.originalFilesLocationCache[sourceFile] = sourceFile; + } + } + + return { sourceFile: this.originalFilesLocationCache[sourceFile], line: originalPosition.line, column: originalPosition.column }; } } } From 6caa596a15f4a416e4d7f6ecba483f211a342d6c Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Wed, 19 Feb 2020 13:46:42 +0200 Subject: [PATCH 7/7] chore: update changelog for 6.4.1 release --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f65a231091..5b6445ac82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,9 @@ NativeScript CLI Changelog ### Fixed +* [Fixed #5236](https://github.com/NativeScript/nativescript-cli/issues/5236): File paths from device logs are not clickable * [Fixed #5251](https://github.com/NativeScript/nativescript-cli/issues/5251): External files are not livesynced +* [Fixed #5252](https://github.com/NativeScript/nativescript-cli/issues/5252): Logs from platform specific files point to incorrect file 6.4.0 (2020, February 11)