Skip to content

Bun build is not working with supabase-js #922

@Asabbagh404

Description

@Asabbagh404

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

I'm getting the error:

> app@1.0.50 build
> bun build src/index.ts --outdir ./build --target bun

11 | import nodeFetch, { Headers as NodeFetchHeaders } from '@supabase/node-fetch';
                         ^
error: No matching export in "node_modules/@supabase/node-fetch/lib/index.js" for import "Headers"
    at /home/anthony/dev/gustave/gustave-backend/node_modules/@supabase/supabase-js/dist/module/lib/fetch.js:11:21
Error: Command failed: /home/anthony/dev/gustave/gustave-backend/node_modules/@oven/bun-linux-x64/bin/bun build src/index.ts --outdir ./build --target bun
    at checkExecSyncError (node:child_process:885:11)
    at execFileSync (node:child_process:921:15)
    at /home/anthony/dev/gustave/gustave-backend/node_modules/bun/bin/bun:405:66 {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 103795,
  stdout: null,
  stderr: null
}

When trying to build with bun

To Reproduce

  1. Install bun
  2. Install Supabase-js
  3. Import supabase
  4. Do the command "bun build src/index.ts --outdir ./build --target bun"

Expected behavior

Bun build correctly without having error

Screenshots

Screenshot from 2023-12-04 13-04-26

System information

  • OS: Linux amd64
  • Version of supabase-js: 2.38.5
  • Version of Bun: 1.0.15

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions