0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

[Next.js] Error: connect ECONNREFUSED or process.processTicksAndRejections

Last updated at Posted at 2023-12-10

1. Countermeasures

Issue: Not localhost

# Frontend server with Next.js
next dev
# Backend server with FastAPI and uvicorn
uvicorn app:app --reload

Solution: Explicitly specify IP address.

# Frontend server with Next.js
next dev -H 192.168.11.2
# Backend server with FastAPI and uvicorn
uvicorn app:app --reload --host 192.168.11.2

It's necessary to explicitly specify the IP address for both.

2. Background

  1. Trying to check the screen from a smartphone by connecting to the development server 192.168.11.2
  2. The images stored on the backend server are not displayed
  3. Change the URL of the backend server accessed by the Next.js frontend server from localhost to 192.168.11.2
  4. An error occurs with fetch

3. Cause

Not very clear.

4. Related

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?