Skip to content

Bun build is not working with supabase-js #922

Closed

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

Activity

  1. added
    bug
    on Dec 4, 2023
  2. Asabbagh404 commented on Dec 4, 2023

    @Asabbagh404
    Author

    A solution is to considere supabase as external using --external @supabase but it will import the whole package

  3. Asabbagh404 commented on Dec 4, 2023

    @Asabbagh404
    Author

    My bad, it's working when i remove my cache. Sorry for bothering

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions