Skip to content

Logs from platform specific files point to incorrect file #5252

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

Closed
rosen-vladimirov opened this issue Feb 19, 2020 · 0 comments
Closed

Logs from platform specific files point to incorrect file #5252

rosen-vladimirov opened this issue Feb 19, 2020 · 0 comments
Assignees
Milestone

Comments

@rosen-vladimirov
Copy link
Contributor

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 6.4.0
  • Cross-platform modules: Not applicable
  • Android Runtime: Not applicable
  • iOS Runtime: Not applicable
  • Plugin(s): Not applicable

Describe the bug
CLI parses device logs and replaces the file path locations in them with local paths to the project. However, in case the filepath is from platform specific file, the path in the logs points to a non-existent file instead of the platform specific one.

To Reproduce

tns create myApp --js
cd myApp
mv app/main-page.js app/main-page.ios.js
# edit app/main-page.ios.js and add `console.trace("MAIN PAGE"); in the `onNavigatingTo` method.
tns run ios

Check the logs:

CONSOLE TRACE file:///app/main-page.js:21:0: MAIN PAGE
onNavigatingTo(file:///app/main-page.js:21:0)

However, we do not have such file, it should point to main-page.ios.js file.

Another way to reproduce the issue

tns create myApp --js
cd myApp
# edit main-view-model.js and in the onTap handler add throw new Error("some error");
tns run ios

Check the logs and the callstack - the callstack contains some lines about button:

file:///node_modules/@nativescript/core/ui/button/button.js:216:0

However, there's no button.js at this location, it should be button.ios.js

Expected behavior
File paths should be correct.

Sample project

Additional context
The issue is not reproducible with Angular project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants