Problem with import aliases in tsconfig
See original GitHub issueHi,
I apologize if I shouldn’t ask here, but since I didn’t get an answer from Stackoverflow, I thought you might be able to help me:
here is the question I asked on Stackoverflow
In a nutshell, I have set up import aliases in my tsconfig.json
, but when I use tsc
to compile the code, it’s complaining that it cannot find the modules.
I would really, really appreciate if you could help me
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Typescript — How to solve the problem with unresolved ...
Generally, what should be done can be summarized as follows: Take a look into tsconfig.json and check if there are path aliases defined...
Read more >Typescript – How to solve the problem with unresolved path ...
The problem. Setting up path aliases in the tsconfig.json file is really a nice approach to making your imports look clear and tidy....
Read more >Getting import errors on modules using alias in tsconfig
I'm getting intellisense (red squiggles) on my aliased imports, but the project builds OK and runs without error.
Read more >Can't import files defined as aliases in tsconfig.json under ...
It's because importing what's outside the workspace(where the package.json lies) is really really bad idea. I've tried this but not recommend it ...
Read more >How to configure and resolve path alias with a Typescript Project
Path alias is a way to define an absolute path in your typescript project ... we will find a more barable import statement,...
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
Thank you @jonaskello for all the help; I appreciate it
Unfortunately
tsc
does not support transforming the imports. You basically have two options:Use tsconfig-paths with node like this:
node -r tsconfig-paths/register out/main.js
(see the docs.Build or find a tool that with transform the imports for you.
Closing since the original issue is sorted.