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.

tsconfig's compilerOptions' paths setting ignored

See original GitHub issue

TypeScript allows to modify module resolution using the paths configuration option on the compilerOptions object. The mechanics of this are described in https://www.typescriptlang.org/docs/handbook/module-resolution.html. This feature is necessary for avoiding the relative path hell by aliasing the root of the current project, and importing files relative to that root.

Currently imports that contain an alias from the paths configuration are reported with the “Cannot find module” error, even though tsc resolves them correctly.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:17
  • Comments:16 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
poplarDevcommented, Jan 20, 2019

+1 for this issue.

3reactions
rgpubliccommented, Sep 30, 2021

Has anyone ever gotten this to work? I define paths and if I use them e.g. in triple slash directives and hover over them, however, I get: Cannot find type definition file for ‘@yadayada/test’. So it seems the @yadayada is not even resolved in the first place…?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why are these tsconfig paths not working? - Stack Overflow
But with some packages (tsc-alias & module-alias), it works. No babel or webpack setup are required. // tsconfig.json { "compilerOptions": { ...
Read more >
TSConfig Reference - Docs on every TSConfig option
All relative paths found in the configuration file will be resolved relative to the ... code is ignored; false raises compiler errors about...
Read more >
How to solve the problem with unresolved path aliases in ...
js file containing the line with the path alias. The actual cause of the issue is that the tsc compiler does not transpiles...
Read more >
Options | ts-node
Most options can be declared in your tsconfig.json: Configuration via tsconfig. ... -vvv includes absolute paths to ts-node and typescript installations.
Read more >
Typescript Compiler not ignoring excluded paths - YouTrack
1. Add a directory (root -> directory) with typescript files in it. · 2. Add this directory to the "exclude" option in the...
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