How to Fix Gutenberg Error “Cannot Read Property ‘show_ui’ of undefined”

This error shows when you’re using the NGINX web server, you probably just finish setting up everything for your new WordPress site and unfortunately, received this error message when trying creating or editing a post in WordPress’ new editor, the Gutenberg.

Users will receive a similar error when using trying to use the Gutenberg editor. It also mentions some js files like editor.min.js and the react-dom.min.js.

TypeError: Cannot read property 'show_ui' of undefined
    at https://codefaq.org/wp-includes/js/dist/editor.min.js?ver=9.7.6:11:122506
    at i (https://codefaq.org/wp-includes/js/dist/vendor/lodash.min.js?ver=4.17.15:6:91)
    at An.filter (https://codefaq.org/wp-includes/js/dist/vendor/lodash.min.js?ver=4.17.15:99:338)
    at https://codefaq.org/wp-includes/js/dist/editor.min.js?ver=9.7.6:11:122470
    at je (https://codefaq.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:78:476)
    at ph (https://codefaq.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:215:173)
    at lh (https://codefaq.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:126:409)
    at O (https://codefaq.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:121:71)
    at ze (https://codefaq.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:118:14)
    at https://codefaq.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:53:49

The main cause of the problem is not actually on these files. But in some configurations on your Nginx directives for handling PHP files.

How to Fix the Error

Simply edit your Nginx conf files with your favorite editor, in our case its “/etc/nginx/sites-available/codefaq.org”.

vim /etc/nginx/sites-available/codefaq.org

Now, find the location / { blocks and look and edit the PHP try_files directive. Replace it with this one.

location / {
  try_files $uri $uri/ /index.php?$args;
}

Save the conf file :wq! and restart your Nginx web server.

sudo service nginx restart

That’s it! The error should go away now, and you’re ready to use your new WordPress site.

1 Comment

  • Dejan Jovic
    Posted May 2, 2020 10:45 pm 0Likes

    Thanks, this helps.

Leave a Comment

trabzon escort yalova escort Samsun escort izmit escort nazilli escort