Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled promise rejection Error: "[object Object]" #12982

Closed
usmaniqbalse opened this issue Dec 18, 2018 · 10 comments
Closed

Unhandled promise rejection Error: "[object Object]" #12982

usmaniqbalse opened this issue Dec 18, 2018 · 10 comments
Labels
[Status] Needs More Info Follow-up required in order to be actionable. [Type] Help Request Help with setup, implementation, or "How do I?" questions.

Comments

@usmaniqbalse
Copy link

usmaniqbalse commented Dec 18, 2018

I am not able to create a post. I am using twentynineteen theme without any plugin. "Unhandled promise rejection Error: "[object Object]"" error is occurring in console. I am using WordPress image "wordpress:5.0.0-apache" from docker hub.

Screenshot: https://prnt.sc/lwjqfh

12982

  • OS: Ubantu
  • Browser: Firefox
  • Version: 61.0.1
@designsimply designsimply added [Type] Help Request Help with setup, implementation, or "How do I?" questions. [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed labels Dec 18, 2018
@designsimply
Copy link
Member

Thank you for posting screenshots of the console errors!

I noticed the same errors are reported at #12208 and I would like to close the issue here and continue the discussion in #12208 with a note that if we find the case to be different we can re-open this issue.

@designsimply
Copy link
Member

Re-opening because the person who opened #12208 said the issue resolved for them automatically.

@designsimply designsimply reopened this Dec 21, 2018
@designsimply designsimply added [Status] Needs More Info Follow-up required in order to be actionable. and removed [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed labels Dec 21, 2018
@designsimply
Copy link
Member

designsimply commented Jan 7, 2019

If you are still having trouble, please update to the latest stable release of WordPress and please check to make sure your site's API is working properly. You can do that by adding wp-json to the end of your site URL—if you get back an error, you will need to investigate why the API is not working for your site. Otherwise, you should just see a whole lot of text.

If you find you are still having trouble, please ask to re-open this issue (or create a new one) with any relevant details you may have found in addition to your earlier report.

@charwick
Copy link

FWIW for future people having this problem, the REST API won't work if you turn on pretty permalinks but don't update your .htaccess.

For Gutenberg's part, would it be any trouble to print a more descriptive error in the console (e.g. "REST API not accessible")?

@aduth
Copy link
Member

aduth commented Jan 30, 2019

The messaging will be improved here very slightly as of #13315 (slated for Gutenberg 5.0), but only in logging the actual error object rather than "[object Response]".

On Gutenberg's part, these errors should ideally never occur, either being accounted for on a case-by-case basis with some graceful fallback (or UI messaging, not console messaging). Alternatively, I could imagine it as part of some generalized WordPress "site checkup" feature to detect possible misconfigurations like the one you describe.

@jaumemirallesisern
Copy link

I keep getting the same error. It doesn't seem that my .htaccess is a problem, it gets updated... More details here.
My firefox console shows the same sight as shown by @usmaniqbalse

@designsimply
Copy link
Member

@jaumemirallesisern I'm not sure yet what might be going wrong in your case but as a first check and since you didn't mention it the linked support forum post, did you test to make sure your site's API is working as expected?

@designsimply designsimply reopened this Apr 3, 2019
@jaumemirallesisern
Copy link

@designsimply thanks for your response.
Yes, I realized of this thread in Github after posting in forum.
If I type in browser bar: theurltomysite/wp-json
I get a 404 Not found error
(just in case... my url has a subdomain)

@youknowriad
Copy link
Contributor

@jaumemirallesisern There are different reasons for the Rest API to not work properly.

Unfortunately, we can't do anything about it in the Gutenberg repo. you should try to debug and find the culprit for your particular use-cases. One first step could be to check the response content of the network request triggering the issue. (in your browser console's network tab)

@anova
Copy link

anova commented Jul 18, 2019

I will share my experience on here. My problem with my theme's functions.php there is a shortcode function which is using ob_start() and ob_get_clean() functions. When I activate another theme, or empty the functions.php, problem is gone. For solution, I wrapped in if( is_admin() ): the shortcode definition ( add_shortcode part ) and the shortcode function.

Maybe this help you too. Try empty your theme's functions.php (of course backup first, heheh) if problem is gone when your functions.php, is empty, look the ob_start() and ob_get_clean() functions and disable for admin panel. Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Needs More Info Follow-up required in order to be actionable. [Type] Help Request Help with setup, implementation, or "How do I?" questions.
Projects
None yet
Development

No branches or pull requests

7 participants