Topic: Object(...) is not a function on Angular 7

Martin Paucot free asked 4 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):

Thanks in advance.

Arkadiusz Idzikowski staff answered 4 years ago

This code: "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+"

yogendersingh free commented 2 years ago

What is difference between npm i ng-uikit-pro-standard and git+"

Arkadiusz Idzikowski staff commented 2 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.

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 8.10.1
  • Device: PC
  • Browser: Chrome
  • OS: Ubuntu 19.10
  • Provided sample code: Yes
  • Provided link: Yes