Fix TypeScript compilation and add graceful Supabase client fallbacks in beauty-assistant edge function#113
Merged
Asper Beauty Shop (asperpharma) merged 3 commits intoMar 5, 2026
Conversation
Co-authored-by: asperpharma <252395498+asperpharma@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix TypeScript compilation issues with Deno URL imports
Fix TypeScript compilation and add graceful Supabase client fallbacks in beauty-assistant edge function
Mar 5, 2026
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Free Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
Signed-off-by: Asper Beauty Shop <252395498+asperpharma@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The beauty-assistant edge function had TypeScript compilation errors from unresolvable Deno globals/URL imports, and two
createClientcalls in the website chat path that would crash silently whenSUPABASE_SERVICE_ROLE_KEYwas absent.TypeScript fixes (
supabase/functions/beauty-assistant/index.ts)declare const Deno— ambient declaration soDeno.env.get()is type-safe without Deno lib types@ts-expect-erroron both URL imports (deno.land/std,esm.sh) — resolved at runtime by Supabase Edge, not bytscGraceful client creation — website chat path
Replaced non-null assertions with conditional construction, matching the existing webhook-path pattern:
Applied to both
productContextClientand theadminClientin thecampaignSourcetelemetry block.New npm scripts + utility scripts
healthnode scripts/health-check.jsbrainnode scripts/brain-check.jssync:checknode scripts/sync-check.jsres.ok🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.