connect ECONNREFUSED 127.0.0.1:80 #13316
-
In my
I get connect ECONNREFUSED 127.0.0.1:80. If I put the data fetching on the client side, it works. But I'd like to reder the data on the server side. How to I get the SSR to work? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 35 replies
-
Next recommends you write your server code directly in Otherwise you'd have to put the fully qualified url in your |
Beta Was this translation helpful? Give feedback.
-
I had the same error because of a typo, a |
Beta Was this translation helpful? Give feedback.
-
In my case I had to replace |
Beta Was this translation helpful? Give feedback.
-
I solved it by adding a new path in .env |
Beta Was this translation helpful? Give feedback.
-
Once check your next version. In my case I was using 13v which was causing the error. Upgraded to 14 and this solved the issue. |
Beta Was this translation helpful? Give feedback.
Next recommends you write your server code directly in
getServerSideProps
: https://nextjs.org/docs/basic-features/data-fetching#write-server-side-code-directlyOtherwise you'd have to put the fully qualified url in your
axios.get(`https://my-domain.com/api/trends...`)
because the server doesn't know what your domain is.