Skip to content

getting TypeError: Failed to fetch #12840

Open
@ar-chit

Description

@ar-chit

Environment

 System:
    OS: macOS 15.1.1
    CPU: (8) arm64 Apple M1
    Memory: 664.33 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.12.0 - ~/.nvm/versions/node/v22.12.0/bin/node
    npm: 10.9.0 - ~/.nvm/versions/node/v22.12.0/bin/npm
    pnpm: 9.15.0 - /opt/homebrew/bin/pnpm
    bun: 1.1.4 - ~/.bun/bin/bun
    Watchman: 2024.11.25.00 - /opt/homebrew/bin/watchman
  Browsers:
    Brave Browser: 134.1.76.82
    Chrome: 134.0.6998.166
    Safari: 18.1.1
  npmPackages:
    @auth/prisma-adapter: ^2.8.0 => 2.8.0 
    next: 15.2.3 => 15.2.3 
    next-auth: ^5.0.0-beta.25 => 5.0.0-beta.25 
    react: ^19.0.0 => 19.0.0 

Reproduction URL

https://github.com/ar-chit/twitter-clone

Describe the issue

While trying to log in using the Credentials provider, It throws TypeError: Failed to fetch in browser's console.

Screen.Recording.2025-04-03.at.12.35.46.mov

Browser's console (development):

Image

Browser's console (production):

Image

Terminal:

Image

Network Tab:

Image

How to reproduce

  1. clone this repo: https://github.com/ar-chit/twitter-clone.git
  2. install dependencies: npm i
  3. start the project: npm run dev
  4. open the localhost link and try to login, you'll see the issue.

.env:
DATABASE_URL=postgres-url
AUTH_SECRET="izlp6unU+8O2DqrzSCJAeN1Ae/VAbvpADw7hDHTYD2U="

Alternatively, you can see the issue on https://twitter-clone-brown-delta.vercel.app

Expected behavior

The user shall log in successfully if the credentials entered are correct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageUnseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions