Relative paths no longer working
See original GitHub issueMy 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:
- Created 2 years ago
- Comments:11 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok. I found the issue.
Analysis
By default, PathIntellisense reads the baseUrl in the tsconfig.
For example, if the tsconfig looks like this:
“src” would we used as a key to
${workspace}/src
With Angular, the baseUrl is set to:
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:
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.
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.
Thanks so much for this release. I can confirm that the issue is fixed with this new version.