Skip to content

Uploaded .docx and .xlsx files are corrupted when using tus-server-node with Supabase S3 Storage #697

@enriquesantos-dev

Description

@enriquesantos-dev

Bug report

Describe the bug

When uploading .docx and .xlsx files using tus-server-node with @tus/s3-store (configured to use Supabase Storage via S3-compatible API), the files are saved corrupted. They cannot be opened by Microsoft Word, Excel, or Google Docs/Sheets after being uploaded.

Interestingly, .pdf files upload and open correctly using the exact same pipeline. Additionally, when I tested the same codebase with a native AWS S3 bucket instead of Supabase, all file types — including .docx and .xlsx — worked correctly. This suggests the issue may be related to Supabase's S3 compatibility.

To Reproduce

https://github.com/EnriqueSantos-dev/uppy-tus-server-supabase-s3-bug

Expected behavior

The uploaded .docx and .xlsx files should be saved and retrievable in a usable format, just like .pdf files. All supported MIME types should be stored without corruption.

Screenshots

No visual errors, but files are unreadable after upload. Opening them triggers a warning or error from Google Docs/Excel indicating the file is invalid or corrupted.

System information

OS: windows (wsl 2)

Browser: Chrome (latest)

Version of supabase-js: N/A (upload uses direct S3-compatible API)

Version of Node.js: 22.15.0

Server: Next.js v15.1.8 (App Router)

tus-server-node: @tus/server v2.2.0 and @tus/s3-store v2.0.0

Client: uppy.js v4.4.4 with @uppy/tus v4.2.2

Additional context

Here is a summary of my configuration:

  • @tus/s3-store is configured with forcePathStyle: true and uses Supabase credentials.

  • uppy.js is configured with the correct MIME types:

    allowedFileTypes: [
      "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
      "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
    ]
  • Files are uploaded successfully, but corrupted when retrieved — even directly from the Supabase dashboard.

  • Uploading to a native AWS S3 bucket using the exact same setup works perfectly for all file types.

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