Skip to content

Wait for services to be healthy on supabase start and supabase db reset #146

@soedirgo

Description

@soedirgo

Bug report

Describe the bug

Immediately after supabase start & supabase db reset, services (Auth, Storage, etc.) might not be ready yet, so API calls would fail.

To Reproduce

❯ cat index.js
const { createClient } = require('@supabase/supabase-js')
const supabase = createClient(
  'http://localhost:54321',
  'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiJ9.ZopqoUt20nEV9cklpv9e3yw3PVyZLmKs5qLD6nGL1SI',
)
supabase.auth.signUp({ email: 'a@a.com', password: 'foobar' }).then(console.log)

❯ supabase db reset && node index.js
Finished supabase db reset on branch main.
{
  user: null,
  session: null,
  error: { message: 'Database error finding user', status: 500 }
}

Expected behavior

Wait for services to be healthy.

System information

  • OS: macOS
  • Version of CLI: v0.16.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    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