Magento – Magento 2: Uncaught TypeError: Cannot read property ‘items’ of null for restricted permission user

consoleerrormagento2magento2.2magento2.2.7

Note: This is not a duplicate of any similar error

I have found a strange bug in Magento 2. It shows the following error in the browser's console for only restricted admin user (the user which has not full rights of the admin panel).

Uncaught TypeError: Cannot read property 'items' of null
    at UiClass.onRequestComplete (data-storage.js:270)
    at fire (jquery.js:3232)
    at Object.fireWith [as resolveWith] (jquery.js:3362)
    at done (jquery.js:9840)
    at XMLHttpRequest.callback (jquery.js:10311)

Console Error

To replicate the issue, follow the process below:

  • Login to the backend with a user with full backend permission.
  • Create a new user role from System >> User Roles with Custom Resource Access. For example, select only the Dashboard from the resources list. (You can choose any other)

Create role

  • After creating the role, create a new admin user with the role which you created in the previous step.
  • Login to the backend with new user's login credentials in another browser or after logging out the current user.
  • Open the browser's console and check the error mentioned above.

Note: I have noticed the same error from Magento versions 2.2.4 to 2.2.7.

Best Answer

after adding resource 'Basic Configuration Section' under 'Stores->Settings->Configuration', My local loaded fine.

enter image description here

Related Topic