-
Notifications
You must be signed in to change notification settings - Fork 31
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
Failed to fetch baseUrl #13
Comments
@adityaas26 Could you solve it? Where do you use this var 'status'? |
@adityaas26 I tried https://discover.wordpress.com, and it doesn't look like they have the REST API enabled? Try using https://wordpress.org as your baseUrl instead. |
Yes, @thetre97 the problem's with the wordpress.com domain which does not have the required REST API support. You can get the support by adding your own custom domain to your WordPress sites. |
I have tried with my own wordpress site but still it doesn't work. i am getting same error, i tried removing code from |
after testing with many wordpress sites, i can confirm onething. if a wp site was started long back say 5yrs back..then it throws TypeError: Cannot destructure property `status` of 'undefined' or 'null'.
at WordPressSource.fetch (C:\laragon\www\my-gridsome-project\node_modules\@gridsome\source-wordpress\index.js:172:40)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7) but if it is a new wp installation, then it works fine. so there must be something in old wp installations, which is root cause of the problem. |
I just had this issue, in my case, there was an echo() function left in one of my functions.php file, that outputed some text in my REST API response, turning it into an unvalid json. You can try to access all your REST API url to check if the datas are good, or you can just console.log your data response in each get functions of source-wordpress/index.js file. For example, line 95 :
|
@adityaas26 : I'm not able to access to this url: https://discover.wordpress.com/wp-json/wp/v2/posts Check your permalinks options on https://discover.wordpress.com/wp-admin/options-permalink.php ✔️ The best option could be to try this with a fresh installation. Hope this helps |
I am unable to fetch data from the WordPress url. I simply put the url of the WordPress website in the baseUrl field.
The error says:
Here's the code in gridsome.confg.js:
Everything else is the same as in the gridsome WordPress starter template.
The text was updated successfully, but these errors were encountered: