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.

Does not work for path mapping starting with `/`

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Reactions:8
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

9reactions
surgicaIcommented, Nov 19, 2020

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 same

4reactions
qmg-akaracommented, Dec 2, 2021

Hello, 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 have paths: { "/opt/nodejs/*": "packages/layer/src/*" } in tsconfig file. But this bug causes linting issues so we temporarily disabled import/no-unresolved which is not great.

Thanks for the great work!

Read more comments on GitHub >

github_iconTop 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 >

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