Skip to content
This repository was archived by the owner on Oct 9, 2025. It is now read-only.

TypeError: fetch failed - Nextjs 13 #178

@felri

Description

@felri

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

Sending large files (5-20mb) always returns me fetch failed using Nextjs 13

To Reproduce

const uploadResult = await storageClient
  .from(STORAGE_BUCKET)
  .upload(filePath, file, {
    contentType: `video/${fileExt}`,
    upsert: true
  });

give me:

TypeError: fetch failed
    at Object.fetch (node:internal/deps/undici/undici:11522:11) {
  cause: Error: write EPIPE
      at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16)
      at WriteWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
    errno: -32,
    code: 'EPIPE',
    syscall: 'write'
  }
}

Additional context

It seems that nextjs 13 removed node-fetch in favor of undici and this is causing a lot of problems, any chance that this bug is related to mine?

vercel/next.js#54961

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions