Uncaught TypeError: Cannot read property 'notifications' of undefined - after updating admin plugin

After updateing admin panel, my plugin throws an javascript error in admin.min.js.

admin.min.js?5a66ee27e0:1089 Uncaught TypeError: Cannot read property 'notifications' of undefined
    at canFetchNotifications (admin.min.js?5a66ee27e0:1089)
    at Module.40535 (admin.min.js?5a66ee27e0:1244)
    at __webpack_require__ (admin.min.js?5a66ee27e0:14897)
    at admin.min.js?5a66ee27e0:15065
    at Function.__webpack_require__.O (admin.min.js?5a66ee27e0:14941)
    at admin.min.js?5a66ee27e0:15066
    at admin.min.js?5a66ee27e0:15069

Is there a simple solution to fix this issue? I’m not really familiar with webpack requirement.

@christiana83, Did a search on the Admin issues and a similar issue was reported in April

Uncaught TypeError: Cannot read property ‘notifications’ of undefined
at canFetchNotifications (notifications.js?fbcd:5)
at eval (notifications.js?fbcd:138)
at Module…/app/updates/notifications.js (admin.min.js?84df16de0b:561)
at webpack_require (admin.min.js?84df16de0b:1224)
at eval (index.js:15)
at Module…/app/updates/index.js (admin.min.js?84df16de0b:550)
at webpack_require (admin.min.js?84df16de0b:1224)
at eval (main.js:13)
at Module…/app/main.js (admin.min.js?84df16de0b:328)
at webpack_require (admin.min.js?84df16de0b:1224)

Would you mind having look at its solution?

Hi @pamtbaau ,

Thank you for your answer! I found this issue before but there was no hint about the problem. They fixed it only by removing “Admin Addon User Manager” plugin.

Is it something with the notes that are displayed in admin on save or other events?

In Admin Plugin v1.10.12 in file " user/plugins/admin/themes/grav/templates/partials/javascript-config.html.twig "

user.authorized

is added to the twig File.

In another custom plugin in twig the variable “user” is also set and overrides the “user” variable from admin. Changing the “user” in the other plugin solves the problem.

1 Like

@christiana83, Thanks for sharing.

In another custom plugin…

Your answer could probably be me more valuable if you share which other plugin causes the issue.

@pamtbaau it is custom plugin in our project that implements an intern review workflow. It is not a public plugin.

1 Like