• Resolved guif

    (@guif)


    Hi,

    When I try to navigate on certain admin page the following error message is displayed on developer tools using WordPress 6.1

    TypeError: undefined is not an object (evaluating 'e.user.capabilities[t]') — index.js:1

    Has anybody else encountered this, and have you found a solution?

    Many thanks. Guif

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support WilloftheD

    (@abzlevelup)

    Hi @guif, that’s not good. This is the first time I saw this issue. For me to help you better, I should be able to see the page. Could you share the direct URL to the page you’re having issues with? I’d like to check and see what we could do here.

    Please do not share any credentials, this is for us to follow the WordPress Forum Guidelines.

    Looking forward to helping you with this one.

    Best
    Abz

    Thread Starter guif

    (@guif)

    Hi,

    I detect this problem on both pages:

    https://www.xxxxxxx.com/wp-admin/admin.php?page=wc-admin
    https://www.xxxxxxx.com/wp-admin/admin.php?page=wc-admin&path=/analytics/overview

    Also I see this on Console:

    TypeError: Cannot read properties of undefined (reading 'manage_woocommerce')
        at currentUserCan (index.js?ver=7.0.1:2:137662)
        at index.js?ver=7.0.1:2:370587
        at Array.filter (<anonymous>)
        at index.js?ver=7.0.1:2:370561
        at ct (react-dom.min.js?ver=17.0.1:9:43430)
        at os (react-dom.min.js?ver=17.0.1:9:111136)
        at Ur (react-dom.min.js?ver=17.0.1:9:77643)
        at Ir (react-dom.min.js?ver=17.0.1:9:77571)
        at Dr (react-dom.min.js?ver=17.0.1:9:77434)
        at Pr (react-dom.min.js?ver=17.0.1:9:74429)

    and

    TypeError: Cannot read properties of undefined (reading 'manage_woocommerce')
        at currentUserCan (index.js?ver=7.0.1:2:137662)
        at index.js?ver=7.0.1:2:370587
        at Array.filter (<anonymous>)
        at index.js?ver=7.0.1:2:370561
        at ct (react-dom.min.js?ver=17.0.1:9:43430)
        at os (react-dom.min.js?ver=17.0.1:9:111136)
        at Ur (react-dom.min.js?ver=17.0.1:9:77643)
        at Ir (react-dom.min.js?ver=17.0.1:9:77571)
        at Dr (react-dom.min.js?ver=17.0.1:9:77434)
        at Pr (react-dom.min.js?ver=17.0.1:9:74429)

    Thanks

    • This reply was modified 3 years, 6 months ago by guif.
    Thread Starter guif

    (@guif)

    maybe it’s possible to grant this permission on database?

    Thread Starter guif

    (@guif)

    I see this error inside fatal error logs under WooCommerce > Status > Logs

    2022-10-18T10:46:42+00:00 CRITICAL Uncaught DivisionByZeroError: Division by zero in /var/www/html/nutricion-herbal.com/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php:348
    Stack trace:
    #0 /var/www/html/nutricion-herbal.com/wp-includes/rest-api/class-wp-rest-server.php(1143): WP_REST_Users_Controller->get_items()
    #1 /var/www/html/nutricion-herbal.com/wp-includes/rest-api/class-wp-rest-server.php(990): WP_REST_Server->respond_to_request()
    #2 /var/www/html/nutricion-herbal.com/wp-includes/rest-api/class-wp-rest-server.php(414): WP_REST_Server->dispatch()
    #3 /var/www/html/nutricion-herbal.com/wp-includes/rest-api.php(394): WP_REST_Server->serve_request()
    #4 /var/www/html/nutricion-herbal.com/wp-includes/class-wp-hook.php(307): rest_api_loaded()
    #5 /var/www/html/nutricion-herbal.com/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #6 /var/www/html/nutricion-herbal.com/wp-includes/plugin.php(524): WP_Hook->do_action()
    #7 /var/www/html/nutricion-herbal.com/wp-includes/class-wp.php(398): do_action_ref_array()
    #8 /var/www/html/nutricion-herbal.com/wp-includes/class-wp.php(770): WP->parse_request()
    #9 /var/www/html/nutricion-herbal.com/wp-includes/functions.php(1330): WP->main()
    #10 /var/www/html/nutricion-herbal.com/wp-blog-header.php(16): wp()
    #11 /var/www/html/nutricion-herbal.com/index.php(17): require('...')
    #12 {main}
      thrown en /var/www/html/nutricion-herbal.com/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php en la línea 348
    Thread Starter guif

    (@guif)

    more tests.

    same problem on all this scenarios:

    – Disable all plugins and put Storefront
    – Disable all plugins with Meks Quick Plugin Disabler and enable. After this enable Woocommerce
    – Disable all plugins. After this enable Woocommerce

    White page when try to access on Woocommerce (Home) and Analytics (and same error)

    Thread Starter guif

    (@guif)

    solved!!!

    Removed this two lines on wp-config.php:

    add_filter( 'rest_user_query', '__return_null' );
    add_filter( 'rest_prepare_user', '__return_null' );

    This two lines protect this endpoint: /wp-json/wp/v2/users

    Plugin Support WilloftheD

    (@abzlevelup)

    Hi @guif, sorry to hear about this and apologies for the delay, I’m back now. Good to know that you were able to figure this out. I’d definitely share this with the team, thanks for sharing.

    I’d be closing this thread and please do not hesitate to bump a new thread on our way. This is for us to track down topics/issues efficiently and for us to follow the WordPress Forum Guidelines.

    Best,
    Abz

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Error “evaluating ‘e.user.capabilities[t]'”’ is closed to new replies.