Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

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

Solved by Christiana View solution

Started by Christiana 5 years ago · 5 replies · 463 views
5 years ago

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

TXT
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.

5 years ago

@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?

5 years ago

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?

5 years ago Solution

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
5 years ago

@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.

5 years ago

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

👍 1

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 82 10 hours ago
General · by pamtbaau, 16 hours ago
1 53 15 hours ago
General · by Andy Miller, 1 day ago
0 45 1 day ago
General · by Marcel, 12 months ago
6 347 5 days ago
General · by Duc , 5 days ago
3 41 5 days ago