Base solution for your next web application
Open Closed

$.unblockUI is not a function #6156


User avatar
0
BobIngham created

This is probably not a Zero problem but perhaps someone can suggest a way i can configure something to get rid of the errors I am getting... In a fresh angular install I have successfully implemented Telerik reporting with no problems. Using the same methods used in the test project I simply add Telerik reporting:

npm install @progress/telerik-angular-report-viewer

As soon as i import the module into my app.module:

import { TelerikReportingModule } from '@progress/telerik-angular-report-viewer';

and apply it to my imports array the Zero system throws the following error in the console of the login page and the page remains blocked to the user:

ERROR TypeError: $.unblockUI is not a function at Object.abp.ui.unblock (abp.blockUI.js:28)

I then took the import away from the app.module and imported it into my project.module which is lazy-loaded. Now I can login but when I select a menu item invoking my lazy-loaded module the same error is thrown.

Does anyone have any idea as to why a third party component should play havoc with Abp? btw - I will post a similar entry on the Telerik forum.


4 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @bobingham

    Do you have jquery blockUI in your angular.json ?

  • User Avatar
    0
    BobIngham created

    Hi @ismcagdas, Yes I do. "node_modules/block-ui/jquery.blockUI.js" What is your thinking here?

  • User Avatar
    0
    BobIngham created

    Any thoughts, @ismcagdas - this is becoming important for me. I tried removing jquery blockUI but that made things even worse! Here is the answer from Telerik:

    In general, the error '$.blockUI is not a function' indicates that this might be related to jQuery library that is not imported as required.

    We have previously had this problem with Angular applications. The following steps helped resolving the issue :

    1. Install jQuery with the script : npm install --save jquery

    2. Import jQuery globally for the application : //in app.module.ts import * as $ from 'jquery';

    Hopefully, the approach would work also for you.

    I believe the Zero implementation iof jquery differs from this and I don't want to run "npm install --save jquery" because i believe we already have it in the system. I have tried the "import * as $ from 'jquery';" in both my app.module and my lazy-loaded, nuagecare.module but the same error persists. This is down at a level where I confess I'm not particularly good with. Any suggestions for me to try next?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @bobingham

    Sorry for the delay.If you have "node_modules/block-ui/jquery.blockUI.js" in the angular.json, then $.unblockUI function must be defined.

    Could you share your packages.json file and angular.json file with the [email protected] and let us take a look at it ?