Hey, I rarely leave a comment on videos, but this one definitely deserves one. I have searched for ages now for a normal, simple, easy-to-follow and understand, simple clear explanation of how the f*** set up a headless project with WP backend and graphql, and everyone is starting to explain the fundamentals of next, and using outdated folders structure, and trying to overcomplicate the process. And I finally found your video. Your video is amazing, simple, on point, no fluff, thank you for that.
I'm running into an error: SyntaxError: Unexpected end of JSON input at JSON.parse () at async getPosts (./app/page.jsx:33:22) at async PostList (./app/page.jsx:37:19) I'm running Node 20.10.0 but also tried on Node 8.(lts version) and made sure my .env is correct. Stopped and restarted the server didn't fix it. Any suggestions on what might be the issue? I'd love to get this up and running. Thanks
I solved this problem. We get this error in case if our wordpress site was not uploaded. Check if you uploaded your WP. If u see console.log(data) u gonna receive undefined
Anyone else having issues with the fetch? It is telling me the fetch failed. I tried testing other things out, and if you make the server component into a client one, and then use `useEffect`, it is able to then finally fetch the data.
Hi there! Please join our Discord community so we can support you with this error. discord.gg/headless-wordpress-836253505944813629 Thank you! -- Sam 🌟 Community Manager
Hey, I rarely leave a comment on videos, but this one definitely deserves one.
I have searched for ages now for a normal, simple, easy-to-follow and understand, simple clear explanation of how the f*** set up a headless project with WP backend and graphql, and everyone is starting to explain the fundamentals of next, and using outdated folders structure, and trying to overcomplicate the process.
And I finally found your video.
Your video is amazing, simple, on point, no fluff, thank you for that.
Anytime!!! Are you in our Discord channel?
This was a godsend. Thank you very much.
thanks I will try
Thanks for the explanation. However, I think there were parts in this video that meant to be edited but you have uploaded the raw version :D
Might have, thanks for the feedback!
Great tutorial thank you. Is there a reason why you used GET for the home page and POST for the posts?
My guess is because you have to pass a body with the query AND variables.. ? Notice in the GET the query is passed as a query param.
i thought graphql only work in pages router. but you are using App router. hows it?
I'm running into an error: SyntaxError: Unexpected end of JSON input
at JSON.parse ()
at async getPosts (./app/page.jsx:33:22)
at async PostList (./app/page.jsx:37:19)
I'm running Node 20.10.0 but also tried on Node 8.(lts version) and made sure my .env is correct. Stopped and restarted the server didn't fix it. Any suggestions on what might be the issue? I'd love to get this up and running. Thanks
i get same issue
I solved this problem. We get this error in case if our wordpress site was not uploaded. Check if you uploaded your WP. If u see console.log(data) u gonna receive undefined
Anyone else having issues with the fetch? It is telling me the fetch failed.
I tried testing other things out, and if you make the server component into a client one, and then use `useEffect`, it is able to then finally fetch the data.
I'm getting this error when I try to install
PS C:\xampp\htdocs
extjs14-headlesswp-example> npm run install
node:internal/modules/cjs/loader:1205
throw err;
^
Error: Cannot find module 'C:\Users
ame\AppData\Roaming
pm
ode_modules
pm\bin
pm-cli.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:1202:15)
at Module._load (node:internal/modules/cjs/loader:1027:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:187:14)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Hi there! Please join our Discord community so we can support you with this error.
discord.gg/headless-wordpress-836253505944813629
Thank you!
-- Sam 🌟 Community Manager