Solvedgutenberg The editor has encountered an unexpected error. (solved by updating the try_files nginx configuration)

Bug Description
Cannot edit a post/draft, it shows 'the editor has encountered an unexpected error'.
Screenshot:
2018-09-14_21h52_36

This happen since upgraded to Gutenberg Version 3.8.0

I've been tried to

  • Disabled all plugins (included Yoast SEO) and browser addons.
  • Attempt recovery doesn't work

Error code

    at http://ngonfig.io/wp-content/plugins/gutenberg/build/editor/index.js?ver=1536809587:12:260789
    at i (http://ngonfig.io/wp-content/plugins/gutenberg/vendor/lodash.min.59550321.js:6:91)
    at An.filter (http://ngonfig.io/wp-content/plugins/gutenberg/vendor/lodash.min.59550321.js:99:338)
    at http://ngonfig.io/wp-content/plugins/gutenberg/build/editor/index.js?ver=1536809587:12:260754
    at yh (http://ngonfig.io/wp-content/plugins/gutenberg/vendor/react-dom.min.82e21c65.js:95:430)
    at lg (http://ngonfig.io/wp-content/plugins/gutenberg/vendor/react-dom.min.82e21c65.js:120:88)
    at mg (http://ngonfig.io/wp-content/plugins/gutenberg/vendor/react-dom.min.82e21c65.js:120:386)
    at gc (http://ngonfig.io/wp-content/plugins/gutenberg/vendor/react-dom.min.82e21c65.js:127:202)
    at vb (http://ngonfig.io/wp-content/plugins/gutenberg/vendor/react-dom.min.82e21c65.js:126:230)
    at ub (http://ngonfig.io/wp-content/plugins/gutenberg/vendor/react-dom.min.82e21c65.js:126:65)

Environment

  • WordPress 4.9.8
  • Gutenberg 3.8.0
  • WordPress is running in localhost with Nginx

Now i'm working with gutenberg 3.7.0 downloaded from https://downloads.wordpress.org/plugin/gutenberg.3.7.0.zip

30 Answers

✔️Accepted Answer

Just to confirm, the following worked for me:

try_files $uri $uri/ /index.php$is_args$args;

@Zenexer & @benpbolton

Other Answers:

Just a note here that nginx configuration templates don't reference try_files directives in this manner; if Gutenberg is going to require

    try_files $uri $uri/ /index.php$is_args$args;

then associated references like:

... may need updating

Solved my issue with:

Content-Security-Policy: worker-src 'self' *.sterm.org data: blob:;

previously I have

Content-Security-Policy: worker-src 'self' data: blob: *.sterm.org ;

PD: Solved in main domain but still here in wordpress sites running as folders, but error is something different:

P.D. 2: Solved in sites running as folders. The issue was a misconfiguration in nginx:
try_files $uri $uri/ /om/index.php$is_args$args ;

The $is_args$args part are missing.

The $is_args$args addition to try_files did it for me. CSP didn't make a difference.

@danielbarenkamp add to root

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

More Issues: