Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"error TS2694: Namespace 'angular' has no exported member 'xxx'" after upgrading @types/angular

After upgrading angular and @types/angular version to version 1.6.x I have lots of TS2694 errors:

error TS2694: Namespace 'angular' has no exported member 'material'
error TS2694: Namespace 'angular' has no exported member 'ui'
error TS2694: Namespace 'angular' has no exported member 'translate'

This worked fine before changing the version number.

What could cause the issue?

like image 288
Sebastien Avatar asked Oct 10 '17 12:10

Sebastien


1 Answers

Manually editing the file like in the accepted answer above caused some issues for me.

Running "yarn upgrade" or altering some packages would revert the manually edited change and my app would be broken again.

To fix this I added a resolution to package.json which fixes the issue of resolving different versions.

"resolutions": {
  "**/@types/angular": "1.6.20"
 },
like image 130
Mike D Avatar answered Nov 09 '22 18:11

Mike D