Reputation: 1345
I try to use the ANT Design NG-ZORRO library in my project. But when I compile the code I get the following warning:
WARNING in ./node_modules/ng-zorro-antd/fesm5/ng-zorro-antd-core.js 2294:66-84
"export 'ɵɵdefineInjectable' was not found in '@angular/core'
This results in a runtime error:
Uncaught TypeError: Object(...) is not a function
at ng-zorro-antd-core.js:2294
at Module../node_modules/ng-zorro-antd/fesm5/ng-zorro-antd-core.js (ng-zorro-antd-core.js:2296)
I searched the internet and tried various version combinations of the packages involved. But was unable to get it to work.
Excerpt of the package.json:
"dependencies": {
"@angular/animations": "^7.2.15",
"@angular/common": "^7.2.13",
"@angular/compiler": "^7.2.13",
"@angular/core": "^7.2.13",
"@angular/forms": "^7.2.13",
"@angular/http": "^7.2.13",
"@angular/platform-browser": "^7.2.13",
"@angular/platform-browser-dynamic": "^7.2.13",
"@angular/platform-server": "^7.2.13",
"@angular/router": "^7.2.13",
"@aspnet/signalr": "^1.1.4",
"@fortawesome/angular-fontawesome": "^0.3.0",
"@fortawesome/fontawesome-svg-core": "^1.2.22",
"@fortawesome/free-regular-svg-icons": "^5.10.2",
"@fortawesome/free-solid-svg-icons": "^5.10.2",
"@nguniversal/module-map-ngfactory-loader": "^7.1.1",
"ajv": "^6.10.0",
"aspnet-prerendering": "^3.0.1",
"bootstrap": "^4.3.1",
"core-js": "2.6.5",
"jquery": "^3.4.0",
"messagepack": "^1.1.10",
"ng-zorro-antd": "^8.3.0",
"popper.js": "^1.15.0",
"rtcp-web-viewer": "^2.0.3",
"rxjs": "^6.5.3",
"zone.js": "^0.9.1"
}
What do I need to do to resolve those warnings and errors to make the package work?
Upvotes: 0
Views: 2946
Reputation: 26821
This is because you're using incompatible versions of the ng-zorro-antd
library with the Angular libraries that you're using.
Versions 8.0.0
and up of the ng-zorro-antd
library require you to update your Angular dependencies to use version 8.0.0
and above (see the release notes for version 8.0.0
for more info).
As such, you have to either:
Update your Angular dependencies to version 8 and up (See the Angular Update Guide for details on what to do to update), or
Downgrade the ng-zorro-antd
library to an older version (in this case, you should use the latest 7.x.x
version - 7.5.1
)
Upvotes: 1