cli icon indicating copy to clipboard operation
cli copied to clipboard

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

Open soedirgo opened this issue 4 years ago • 0 comments

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: '[email protected]', 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

soedirgo avatar Jan 20 '22 15:01 soedirgo