Search code examples
github-actionssupabase

Calling supabse-js createClient from GitHub workflow using Supabase CLI Action fails with ECONNREFUSED


I have a vitest suite I'm trying to run in a GitHub workflow - the tests uses supabase-js / supabase.auth.signUp to create authenticated users. However, I keep getting ECONNREFUSED error (see below).

The workflow uses supabase/setup-cli@v1 - supabase CLI works fine.

Is the Supabase CLI action not intended to expose the web API? (If so, why not?)

 errno: -111,
 code: 'ECONNREFUSED',
 syscall: 'connect',
 address: 'localhost',
 port: 54321

Here is a minimal workflow where this happens: https://github.com/abs/sb-gh-action-test/blob/main/.github/workflows/sb_test.yaml


Solution

  • To fix this:

    Replace

    supabase db start

    With

    supabase start

    ðŸ«