Topic: Object(...) is not a function on Angular 7
Martin Paucot asked 5 years ago
I'm currently working on a old project made by an employee who does not work in the company anymore and we still use his ng-uikit-pro-standard
license.
I do not know which version we are using, I updated the dependency to be sure to use the latest one.
Expected behavior
The application should render normally.
Actual behavior
We get the following error while trying to access to the application:
ng-uikit-pro-standard.js:10904 Uncaught TypeError: Object(...) is not a function
at ng-uikit-pro-standard.js:10904
at Module../node_modules/ng-uikit-pro-standard/fesm5/ng-uikit-pro-standard.js (ng-uikit-pro-standard.js:10906)
at __webpack_require__ (bootstrap:79)
at Module../src/app/app.module.ts (app.component.ts:10)
at __webpack_require__ (bootstrap:79)
at Module../src/main.ts (main.ts:1)
at __webpack_require__ (bootstrap:79)
at Object.0 (main.ts:12)
at __webpack_require__ (bootstrap:79)
at checkDeferredModules (bootstrap:45)
And this Warning while compiling:
WARNING in ./node_modules/ng-uikit-pro-standard/fesm5/ng-uikit-pro-standard.js 10904:57-75
"export 'ɵɵdefineInjectable' was not found in '@angular/core'
package.json (angular related parts): https://pastebin.com/CJycLt3e
Thanks in advance.
Arkadiusz Idzikowski staff answered 5 years ago
This code: "ng-uikit-pro-standard": "git+https://oauth2:key@git.mdbootstrap.com/mdb/angular/ng-uikit-pro-standard.git"
is responsible for installing latest available ng-uikit-pro-standard version (which is 8.10.1 now).
V8 version of our library is not compatible with Angular 7, to install latest MDB version for Angular 7 update this code to:
"ng-uikit-pro-standard": "git+https://oauth2:key@git.mdbootstrap.com/mdb/angular/ng-uikit-pro-standard.git#7.5.4"
yogendersingh commented 3 years ago
What is difference between npm i ng-uikit-pro-standard and git+https://oauth2:key@git.mdbootstrap.com/mdb/angular/ng-uikit-pro-standard.git#7.5.4"
Arkadiusz Idzikowski staff commented 3 years ago
@yogendersingh It is not possible to install MDB Angular directly from the npm public repository. The second command will download the package from the MDB GitLab server.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Free
- Premium support: No
- Technology: MDB Angular
- MDB Version: 8.10.1
- Device: PC
- Browser: Chrome
- OS: Ubuntu 19.10
- Provided sample code: No
- Provided link: Yes