Open SRD75 opened 1 year ago
same error
I ran into this issue and resolved it by:
I ran into this issue and resolved it by:
- using HTTP protocol in the WORDPRESS_API_URL in .env.local file
- added a remotePattern in next.config.js file for pulling in remote images from Wordpress
- updated the site URLs in the Wordpress settings dashboard to also use the HTTP protocol
- components/avatar is still using the layout prop - remove that and add the required height and width props instead
Hi @j0w0,
What do you mean by "using HTTP protocol in the WORDPRESS_API_URL in .env.local file"? Instead of "https://sdoig-nextjs.local/graphql" you did "http://sdoig-nextjs.local/graphql"? (This example is based on OP's endpoint).
Would love to see what you did visually!
Thanks
Verify canary release
Provide environment information
Which example does this report relate to?
cms-wordpress
What browser are you using? (if relevant)
Chrome
How are you deploying your application? (if relevant)
npm run dev
Describe the Bug
npx create-next-app --example cms-wordpress cms-wordpress-app
cd cms-wordpress-app
Only required if you want to enable preview mode
WORDPRESS_AUTH_REFRESH_TOKEN=
WORDPRESS_PREVIEW_SECRET=
1 of 1 unhandled error Server Error TypeError: fetch failed
This error happened while generating the page. Any console logs will be displayed in the terminal window. Source lib\api.ts (13:14) @ async fetchAPI
11 | 12 | // WPGraphQL Plugin must be enabled
I find this strange, as WPGraphQL Plugin is enabled at
https://sdoig-nextjs.local/wp-admin/
Expected Behavior
npm run dev
should load the front end and fetch the home page posts without an error.To Reproduce
Create a new local website using LocalWP, then follow the steps above in
Describe the Bug
.