question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Attempt to automatically de/reference symlinked files

See original GitHub issue

Currently for Node we sometimes require people to pass --preseve-symlinks (and document this) since Node dereferences scripts it loads, which can cause file paths to not patch up.

However we could also use fs.realPath to dereference them ourselves. Breakpoints should be applied in both places (since we won’t know which is the right one ahead of time). Still need to figure out how to deal with loaded sources, however, since when a source loads we need to tell VS code the path it knows about rather than the real path.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
connor4312commented, Mar 25, 2021

@TylerLeonhardt this is expected since without preserve-symlinks-main, “real” is resolved to real/a.js, then it requires real/b.js without hitting the symlink at all.

0reactions
TylerLeonhardtcommented, Mar 25, 2021

So if I set a breakpoint in linked/b.js and line 2 of linked/a.js

if I just have "--preserve-symlinks-main" I go to real/b.js BUT linked/a.js (I expect this) if I have both "--preserve-symlinks-main" and "--preserve-symlinks" I go to linked/b.js and linked/a.js (I expect this) if I just have "--preserve-symlinks" I still go to the real/b.js and real/a.js (I don’t expect this - it should go to linked/b.js and then real/a.js no?)

Read more comments on GitHub >

github_iconTop Results From Across the Web

If file in resource directory is symlink then dereference it when ...
If file in resource directory is symlink then dereference it when asked to save or export file #3764. bug It's a bug stale....
Read more >
boost::exists for symlinks do not dereference - Stack Overflow
This is problematic for me, as I'm trying to get the symlink itself. For example, doing fs::exists("some_symlink") because, although ...
Read more >
Creating a copy of a file, that gets automatically updated
Symlinks are pretty straight forward, but you need to understand the changes are bi-directional, a change to the content of the symlink ......
Read more >
What happens to a symbolic link when the original file is ...
If the symlink target /opt/minergate-cli has been re-created when new version of application was installed, the symlink will point to new file.
Read more >
How do I automatically generate symlinks? - Super User
I'm trying to figure out how to automatically generate symlinks based on file extension. My idea is to have one directory with dynamic ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found