-1

when I tried to edit a post of a custom post type, I experienced this error.

enter image description here

When I press "Copy Error" I am getting this:

TypeError: Cannot read property 'prefix' of null
    at https://example.com/wp-includes/js/dist/edit-post.min.js?ver=3.1.6:12:56693
    at ph (https://example.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.6.3:97:88)
    at eg (https://example.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.6.3:125:307)
    at fg (https://example.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.6.3:126:168)
    at wc (https://example.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.6.3:138:237)
    at fa (https://example.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.6.3:137:115)
    at gg (https://example.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.6.3:135:196)
    at Ca (https://example.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.6.3:133:365)
    at Object.enqueueSetState (https://example.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.6.3:191:324)
    at r.q.setState (https://example.com/wp-includes/js/dist/vendor/react.min.js?ver=16.6.3:20:304)
1

So, I was researching this topic a bit deeper. All answers found on this SE suggested disabling Gutenberg with a plugin. This couldn't be a valid "fix" in my oppinion.

After researching and browsing through the git issues of WordPress/gutenberg I've found a pretty easy solution for this problem.

The user joshuafredrickson on the git suggested changing the args of the custom post type array from 'public' => false, to true.

I have checked that fix on multiple of my clients projects and it has worked every single time.

Credits:

  • How do you do this from the wordpress admin? – Stevie G Jan 9 at 17:56
  • @StevieG Edit the file that includes the custom post-type – marvinpoo Jan 10 at 8:22

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.