Skip to content

Axios in server side components #61431

Closed Answered by icyJoseph
angelzxz1 asked this question in App Router
Discussion options

You must be logged in to vote

Hi,

This is a different kind of error. ECONNREFUSED, means that there's nothing listening for the request.

This is a very well known issue, mostly created by tech-influencers, and AI generated content.

The Next.js community has written a precise explanation and set of steps to fix this problem, here:

The examples use fetch, but the same applies to axios

The short explanation is that you, perhaps thinking that you have made your code modular, or DRY, but that's not correct. You've created an extra HTTP round trip requirement, which defeats the entire purpose of having co…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@icyJoseph
Comment options

Answer selected by angelzxz1
@underground0930
Comment options

@underground0930
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants