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.

Relative paths no longer working

See original GitHub issue

My paths are no longer relative to my current folder since either the 2.6.1 or 2.7.0 update.

I used to be able to do './' and the suggestion would be from my current folder. However it now always suggests from the workspace root folder. All of my settings are default.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
ChristianKohlercommented, Jan 30, 2022

Ok. I found the issue.

Analysis

By default, PathIntellisense reads the baseUrl in the tsconfig.

For example, if the tsconfig looks like this:

 {
 	"baseUrl": "src",
 }

“src” would we used as a key to ${workspace}/src

{
	import {} from 'src/mymodule';
}

With Angular, the baseUrl is set to:

 {
 	"baseUrl": "./",
 }

which means that the “key” is ./ which would then be resolved to ${workspace}/./

The root of the problem is my over simplified solution to how I resolve the baseurl. I only add the baseurl to the mapping list like this:

 {
 	key: "src",
        value: "${workspaceRoot}/src"
 }

Now when you type "src/", the mapping resolved to "${workspaceRoot}/src" showing you all the children of src.

That approach works with all baseUrls, except ./ (afaik).

Short term solution

Just disable the baseUrl support.

image

Long term solution

Not sure yet. I’d either have to rewrite the baseUrl logic to deal with ./ or just ignore it. Not sure.

Thank you all for you inputs. Hope disabling the baseUrl support work for you for now.

0reactions
spfullercommented, Feb 14, 2022

Thanks so much for this release. I can confirm that the issue is fixed with this new version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

img tag not working with relative path in src - Stack Overflow
So when I have url like http://127.0.0.1:7777/www/ then all my relative urls working but then I use it as http://127.0.0.1:7777/www (no "/" at ......
Read more >
I cannot create relative path links - CSS - Codecademy Forums
I am trying to make a basic website on visual studio code editor as part of the arts & crafts project Firstly emphasized...
Read more >
Relative paths not working · Issue #100251 · microsoft/vscode
Steps to Reproduce: Ctrl + Click the import path have to jump to the file/definition. But the relative paths are not working.
Read more >
Bug: Maps saved with relative paths can have broken data ...
Click the Data source button and select 'Store relative paths '. Save the map, or save the existing map to a new name....
Read more >
linux - Relative path to anything not working (while running ...
With even more digging, I've discovered that relative paths work AS LONG AS you do not cross the "boundry" of the root of...
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