Module "ng" has no exported members in vs code

I get Module "ng" has no exported member error messages Module "ng" has no exported member for all my types in Visual Studio Code

enter image description here

enter image description here

My typing worked 100% until I added angular -ui-router. I'm not sure if this is a problem, but I only noticed this after adding this.

In my .d.ts files .d.ts I get a specific error in angular itself.

enter image description here

My tsd.json looks like this

 { "version": "v4", "repo": "borisyankov/DefinitelyTyped", "ref": "master", "path": "typings", "bundle": "typings/tsd.d.ts", "installed": { "angular-material/angular-material.d.ts": { "commit": "5a8fc5ee71701431e4fdbb80c506e3c13f85a9ff" }, "jquery/jquery.d.ts": { "commit": "40c60850ad6c8175a62d5ab48c4e016ea5b3dffe" }, "angularjs/angular.d.ts": { "commit": "40c60850ad6c8175a62d5ab48c4e016ea5b3dffe" }, "angularjs/angular-route.d.ts": { "commit": "5a8fc5ee71701431e4fdbb80c506e3c13f85a9ff" }, "angularjs/angular-cookies.d.ts": { "commit": "5a8fc5ee71701431e4fdbb80c506e3c13f85a9ff" }, "angularjs/angular-animate.d.ts": { "commit": "5a8fc5ee71701431e4fdbb80c506e3c13f85a9ff" }, "angularjs/angular-resource.d.ts": { "commit": "40c60850ad6c8175a62d5ab48c4e016ea5b3dffe" }, "angular-ui-router/angular-ui-router.d.ts": { "commit": "40c60850ad6c8175a62d5ab48c4e016ea5b3dffe" } } } 

I have a little lost what I have or did not do to ruin it. It is strange that everything is still working at 100%. So I'm still getting intellsense for ng. He simply says that there are errors, and every time I build, I get multiple errors in all files.

Update

I ended up commenting on import ng = angular; on line 17 , and then replaced ng.auto.IInjectorService; on angular.auto.IInjectorService; on line 173 in angular.d.ts

This means that every link in the angular application is now executed using angular , not ng , which is not ideal, but now it will be done. I am sure this is not a β€œbest practice fix.”

https://github.com/DefinitelyTyped/DefinitelyTyped/issues/7284

+5
source share
1 answer

Check where you installed angular -ui-router for the additional .d.ts file. Sort of

 ./bower_components/angular-ui-router/api/angular-ui-router.d.ts 

Delete this .d.ts file and restart VSCode. If it does not check the rest of the folders in your project for any duplicate .d.ts files. This is exactly what solved the problem for me.

+1
source

Source: https://habr.com/ru/post/1238759/


All Articles