Skip to content

IDE throws TS2415 while the compiler works #130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
SDries opened this issue Sep 14, 2022 · 1 comment
Closed

IDE throws TS2415 while the compiler works #130

SDries opened this issue Sep 14, 2022 · 1 comment

Comments

@SDries
Copy link

SDries commented Sep 14, 2022

Hello,

I'm using the module for an angular application.
My case is as follows: I have an angular project that uses an angular library.
During development I use npm link to be able to make & view changes in my application without having to publish every change to npm. I use the module so that I can alias some dependencies within my project that are otherwise used from within my library.
The tsc compilation would throw errors such as this:
TS2345: Argument of type 'import(".../node_modules/@angular/common/http/index").HttpClient' is not assignable to parameter of type 'import(".../node_modules/@angular/common/http/index").HttpClient'.

Now that I'm using the module by adding this to my package.json the code compiles just fine which is wonderful

"_moduleAliases": {
  "@angular/common/http": "./node_modules/@angular/common/http"
},

The issue that I'm now facing is that the linting in my IDE (both webstorm & VS Code do this) still gives me the same error.
(ng lint gives no errors)

TS2415: Class 'X' incorrectly extends base class 'Y'.   Types of property 'http' are incompatible.

Does anyone know how I can tell my IDE that the module has been aliased?
I already tried adding a webpack.config.js file as was suggested here: #105

Thank you

@SDries
Copy link
Author

SDries commented Sep 15, 2022

I ended up removing the module & using the tsconfig paths: https://www.typescriptlang.org/tsconfig#paths

@SDries SDries closed this as completed Sep 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant