tsconfig paths not recognized

Completed

I am using VS2019 16.7.7 and Resharper 2020.2 do do Angular 10 development.

In the root of my project I have a tsconfig.base.json. where I have defined some path aliases like:

 

I can use them just fine in my components by referencing like this:

Everything builds and runs fine. VS code has no problem with this or just Visual Studio on its own. However, when I am using Resharper, it does not recognize the imports and wants to create its own with the '../../../' syntax. So my code looks all broken. I have played with the Resharper/Code Editing/Typescript settings but nothing seems to fix it. Does Resharper not support path aliases in tsconfig files?

0
5 comments

Hello,

 

Is there any chance you could provide us a sample solution in which the problem is reproduced?

You can share it privately via "Submit a request" form.

Thank you.

0

I started to create a new project to illustrate and came across the cause. As stated my paths config was in the tsconfig.base.json file (along with most other ts settings). If I cut that out of there and put it in the tsconfig.json file instead the issue resolves. It looks like the tsconfig.base.json is a new feature of typescript which it looks like Resharper is not handling yet.

According to this: https://volosoft.com/Blog/what-is-new-in-angular-10

tsconfig.base.json is the correct place for these types of settings as per typescript docs for the solution style set-up. Hopefully Resharper will adjust to handle this type of set-up so I can put the settings back in the right place.

0

Thank you for the info, Grparkins.

 

Seems to be similar to this request - https://youtrack.jetbrains.com/issue/RSRP-467611.

I've added your comment to the issue, you are welcome to add any other details as well.

Thank you.

0

Hello, Grparkins

Could you please add some repro project to the issue?

0

Was about to prep a repro project but did some more searches first. Found that apparently this solution style of tsconfigs has caused other issues so ng team decided to not include it in upgrade process. Looks like they have, for now, reverted to old style so I will too. So can consider this issue "resolved"

0

Please sign in to leave a comment.