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