Does not work for path mapping starting with `/`
See original GitHub issueI have tsconfig paths configured as:
"paths": {
"/@utils/*": ["src/utils/*"],
"/@services/*": ["src/services/*"],
"/@contexts/*": ["src/contexts/*"],
"/@translations/": ["src/services/system/localization/translations/index"]
},
These fail to resolve to the correct paths due to this line in code: https://github.com/dividab/tsconfig-paths/blob/master/src/try-path.ts#L27
Do we need this check ?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Path mapping using `paths` not work properly? - Stack Overflow
This one '@foobar/shared/dom/utils' will never work, since you are explicitly looking for a directory named dom under directory shared .
Read more >Path Mappings does not work for me
I'am using the remote python interpreter and remote debugging. I am developing on a Mac and I'am running on an linux box. I...
Read more >Error Messages | Maps JavaScript API - Google Developers
This page describes the error messages that can be returned by the Maps JavaScript API. The Maps JavaScript API writes error and warning...
Read more >Path Mapping (Cross-Platform Rendering) — Deadline 10.1 ...
To add a new Path Mapping rule, just click the Add button. Then, you specify the path that needs to be swapped out,...
Read more >HEC-RAS File Name & Directory Path Issues
Note that when you reboot your computer, all mapped drive letters will be reset. To automatically map your folder when your system starts,...
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
Now that typescript also allow the paths to start with a
/
, I believe the solution suggested by @ashubham is correct. Should I create a pull request for the sameHello, is there any update on this?
Our use case: We have a Lambda mono-repo project. We import our lambda layer code as
/opt/nodejs
(this is where AWS Lambda puts our layer code) but as you know this is not available locally so we havepaths: { "/opt/nodejs/*": "packages/layer/src/*" }
intsconfig
file. But this bug causes linting issues so we temporarily disabledimport/no-unresolved
which is not great.Thanks for the great work!