Skip to content

fix: pin supabase CLI to workspace version, fix extensionless edge fn imports - #396

Merged
thinkclay merged 1 commit into
mainfrom
worktree-fix-supabase-cli-pin
Jul 22, 2026
Merged

thinkclay merged 1 commit into
mainfrom
worktree-fix-supabase-cli-pin

Conversation

@thinkclay

Copy link
Copy Markdown
Contributor

Fixes #390.

Problem

The root supa script (and its supa:* variants) invoke pnpx supabase, which resolves the latest published CLI instead of the version pinned in pnpm-workspace.yaml's catalog (supabase: 2.102.0). CLI ≥2.109 requires relative Deno imports to include their extension, and ~15 edge functions imported ../_shared/notifications/utils (and deeper relative variants) without the .ts suffix. That resolved fine under the pinned 2.102.0, but under a newer CLI resolved via pnpx it fails at startup and every local API call 503s — downstream this surfaced as things like "No industries available" in onboarding.

Fix

  1. Changed every pnpx supabase invocation in package.json's supa/supa:* scripts to pnpm exec supabase, so they always resolve the workspace-pinned version regardless of what's cached/latest on the machine.
  2. Added the .ts extension to the extensionless _shared/notifications/utils imports across all 15 edge functions still missing it (the issue named 10; grepping turned up 15 total, including persona-webhook, notify-digest-daily, and the three webhooks/{sms,email,push} functions with the same pattern at a different relative depth) — fixed all of them for consistency, so functions serve doesn't break again the next time the unpinned resolution path (or a future intentional CLI bump) is hit.

Verification

  • Confirmed each import's relative path (../ vs ../../ depending on nesting) still resolves to the existing packages/supabase/functions/_shared/notifications/utils.ts on disk.
  • pnpm exec biome lint is clean on all 16 changed files.
  • git diff package.json touches only the 13 pnpx supabase → pnpm exec supabase occurrences — no other script changes.

Not verified: this sandbox has no Docker daemon, so I couldn't actually run pnpm supa functions serve api and confirm GET /functions/v1/api/v1/industries returns 200 end-to-end, per the issue's acceptance criteria. The change is mechanical and the import paths are confirmed to resolve, but it hasn't been exercised against a live local Supabase stack.

🤖 Opened by the Friday weekly-improvement routine.


Generated by Claude Code

… imports (#390)

The `supa` wrapper (and its variants) invoked `pnpx supabase`, which
resolves the latest published CLI instead of the version pinned in
pnpm-workspace.yaml's catalog (2.102.0). CLI >=2.109 requires relative
imports to include their extension, and ~15 edge functions imported
`_shared/notifications/utils` without the `.ts` suffix — that worked
under the pinned 2.102.0 but 503s under a newer CLI resolved by pnpx,
breaking `functions serve` locally (surfacing as e.g. "No industries
available" in onboarding).

- Changed every `pnpx supabase` invocation in package.json's supa:*
  scripts to `pnpm exec supabase`, so they always resolve the
  workspace-pinned version.
- Added the `.ts` extension to the extensionless
  `_shared/notifications/utils` imports across all 15 edge functions
  still missing it, so functions serve cleanly regardless of which
  CLI version is on PATH.

Verified each import's relative path still resolves to the existing
_shared/notifications/utils.ts file, and biome lint is clean on all
changed files. Could not exercise `pnpm supa functions serve` live in
this sandbox (no Docker daemon available for the local Supabase
stack), so this hasn't been end-to-end verified against a running
instance the way the issue's acceptance criteria describes.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Test Results

0 tests   0 ✅  0s ⏱️
0 suites  0 💤
0 files    0 ❌

Results for commit 2da4bf3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dev: pnpm supa resolves unpinned supabase CLI — functions serve broken on CLI ≥2.109 (extensionless imports)

2 participants