Skip to content

A full-featured CRM built with React, shadcn/ui, and Supabase.

check for the project presence (#229)

Thiery Michel06359feab927
diff --git a/scripts/supabase-remote-init.mjs b/scripts/supabase-remote-init.mjs
index e6972501..a2de747f 100644
--- a/scripts/supabase-remote-init.mjs
+++ b/scripts/supabase-remote-init.mjs
@@ -176,8 +176,9 @@ async function waitForProjectToBeReady({ projectRef }) {
throw new Error("Invalid JSON output");
}
const jsonOuput = JSON.parse(matchJSON[0]);
+
const project = jsonOuput.find((project) => project.id === projectRef);
- if (project.status !== "ACTIVE_HEALTHY") {
+ if (project?.status !== "ACTIVE_HEALTHY") {
await sleep(1000);
return waitForProjectToBeReady({ projectRef });
}