I am using headless wordpress with next.js as described here https://vercel.com/guides/wordpress-with-vercel. It will not compile the next.js site because the connection is refused to the local Wordpress site.
I am able to access the local site using the URL - http://hamletstudiowp.local/
I have updated the .env.local file to include
Hi, I was able to reproduce the error by running npm run dev with the Local server turned off. If you can’t connect to the regular URL either, can you double-check that you have the site running in the top right of the Local UI. There is an option to Start site or Stop site up in the top-right.
I can put the URL in the browser - and it connects. (gives me an error about lack of query which is correct)
Please let me know if you have any other thoughts. From what I have read on StackOverflow etc regarding this error - it appears it wants to see 127.1.0.0 rather than localhost. If others have this working, not sure why it is having an issue with the local url.
No, that doesn’t look normal to me, but it does appear to be a valid entry in /etc/hosts Let me see if I can get some additional eyes on this for you
@sambrockway I am still stuck on this ECONNREFUSED error. I uninstalled everything and started from scratch, and still receiving the same error. Any luck with the logs I sent?
I just used the crash course video verbatim, with Apollo, and it will not connect with that either.
It just comes back with “Error: fetch failed”
1 of 1 unhandled error
Server Error
Error: fetch failed
Any thoughts would be greatly appreciated!
This error happened while generating the page. Any console logs will be displayed in the terminal window.
Call Stack
new ApolloError
file:///mnt/c/git/cms-crashcourse/crash-course-headless-wp-next-wpgraphql/node_modules/@apollo/client/errors/errors.cjs (34:28)
<unknown>
file:///mnt/c/git/cms-crashcourse/crash-course-headless-wp-next-wpgraphql/node_modules/@apollo/client/core/core.cjs (1598:19)
both
file:///mnt/c/git/cms-crashcourse/crash-course-headless-wp-next-wpgraphql/node_modules/@apollo/client/utilities/utilities.cjs (986:53)
<unknown>
file:///mnt/c/git/cms-crashcourse/crash-course-headless-wp-next-wpgraphql/node_modules/@apollo/client/utilities/utilities.cjs (979:72)
new Promise
<anonymous>
Object.then
file:///mnt/c/git/cms-crashcourse/crash-course-headless-wp-next-wpgraphql/node_modules/@apollo/client/utilities/utilities.cjs (979:24)
Object.error
file:///mnt/c/git/cms-crashcourse/crash-course-headless-wp-next-wpgraphql/node_modules/@apollo/client/utilities/utilities.cjs (987:49)
notifySubscription
file:///mnt/c/git/cms-crashcourse/crash-course-headless-wp-next-wpgraphql/node_modules/zen-observable/lib/Observable.js (140:18)
onNotify
file:///mnt/c/git/cms-crashcourse/crash-course-headless-wp-next-wpgraphql/node_modules/zen-observable/lib/Observable.js (179:3)
SubscriptionObserver.error
file:///mnt/c/git/cms-crashcourse/crash-course-headless-wp-next-wpgraphql/node_modules/zen-observable/lib/Observable.js (240:7)
@hamlethub thanks for reaching back out, and apologies for the delay. Did you try out the Atlas add-on that @sambrockway suggested? That was my suggestion, as that will run a Node project in a different way (essentially letting Local manage that piece) that might give us something else to go on if it fails or succeeds.
@JeffEverhart383 I started a new site using the Atlas add-on, and I am still receiving a similar error. With the Atlas add-on, the site will not load at all (with the graphql the site would load, but received error when using node). I receive the following error:
The page you requested generated a server error and could not be processed. If you continue to get this message after refreshing, try restarting the Local site.
The backend (admin) loads correctly… I have attached the logs. Can you please take a look?
Thanks! local-logs2.zip (6.1 KB)