Kuzma02/Electronics-eCommerce-Shop-With-Admin-Dashboard-NextJS-NodeJS

TypeError: fetch failed

bd1354 opened this issue · 3 comments

TypeError: fetch failed
    at async SingleProductPage (./app/product/[productSlug]/page.tsx:26:24)
Cause: Error: read ECONNRESET
    at TCP.onStreamRead (node:internal/stream_base_commons:217:20)
    at TCP.callbackTrampoline (node:internal/async_hooks:130:17) {
  errno: -4077,
  code: 'ECONNRESET',
  syscall: 'read'

I adjusted the database according to myself, did the migrations and ran it, everything was working fine, there was no problem in the project, the database was working in Prisma Studio, I reset the computer and when I connected to the site again, I started getting this error and my database was gone. The interesting thing is that there is still data on the site, but it gives this error in some elements.

I understand. The data is still on the website because of caching, but something happened to the database. I don't know what could cause the database to disappear. If you find a solution to the problem, please feel free to post it here.

npx prisma migrate dev --name init 
Environment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma
Datasource "db": MySQL database "singitronic_nextjs" at "localhost:3306"

Error: P1001: Can't reach database server at `localhost`:`3306`

Please make sure your database server is running at `localhost`:`3306`.

I get this error when i run "npx prisma migrate dev --name init " It related to database I'm trying to fix it right now

I fixed it. I didn't run the sql server lol.I wasn't even aware,thanks for the quick reply @Kuzma02