Token导航 LogoToken导航

Agent Skill · AI 工具

supabase-common-errors(Supabase common errors 命令行)

supabase-common-errors 用于记录任务执行中的错误、用户纠正、经验和能力缺口,适合在 Codex、Claude、Cursor、Gemini CLI 中希望让 Agent 持续沉淀问题、修正和最佳实践时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

supabase-common-errors 是AI 工具类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证为 MIT,第三方扫描已通过,按安装量在AI 工具类的 2,536 个 Skill 里排第 1,424。

总安装 729周安装 31GitHub Stars 2,090下载 255核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:supabase-common-errors(Supabase common errors 命令行)
来源仓库:https://github.com/jeremylongshore/claude-code-plugins-plus-skills
仓库路径:skills/supabase-common-errors
安装命令:
npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus-skills --skill supabase-common-errors
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus-skills --skill supabase-common-errors

这个 Skill 是做什么的

AI 工具类 Skill 用来扩展助手本身的能力,例如接模型、接检索、接外部服务。

记录任务执行中的错误和经验,持续沉淀最佳实践。适合让 Agent 修正问题并积累能力缺口。通过 npx 命令从指定 GitHub 仓库安装并使用该技能。建议确认权限范围和维护状态,避免触发不必要的联网或文件操作。supabase-common-errors 属于AI 工具类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/supabase-common-errors

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus-skill…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

supabase-common-errors 怎么安装?

在终端执行 npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus-skills --skill…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

supabase-common-errors 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

supabase-common-errors 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

supabase-common-errors 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

supabase-common-errors 用的人多吗?

公开数据是累计安装 729 次,近一周安装 31 次,下载 255 次,GitHub 2,090 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

supabase-common-errors 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理AI 工具类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

AI 工具类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
executing-plans

执行计划 · Codex、Claude

1,515,336173,110只读MIT通过
verification-before-completion

完成前的验证 · Codex、Claude

1,319,472173,121权限未标注MIT通过
subagent-driven-development

子 Agent 驱动开发 · Codex、Claude

1,312,416173,138只读MIT通过
copy-editing

复制编辑 · Codex、Claude

1,209,57625,632只读MIT通过
paywall-upgrade-cro

付费专区升级 cro · Codex、Claude

1,030,17625,617只读MIT通过
supabase-common-errors

Supabase common errors 命令行 · 本页

7292,090需要联网MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Supabase Common Errors

Overview

Diagnostic guide for Supabase errors across PostgREST (PGRST*), PostgreSQL (numeric codes), Auth, Storage, and Realtime. Identify the error layer, trace the root cause, and apply the correct fix — every SDK call returns {data, error} where data is null when error exists.

Prerequisites

  • @supabase/supabase-js installed (npm install @supabase/supabase-js)
  • SUPABASE_URL and SUPABASE_ANON_KEY (or SUPABASE_SERVICE_ROLE_KEY) configured
  • Access to Supabase Dashboard (for log inspection and SQL Editor)
  • Supabase CLI installed for local development (npx supabase --version)

Instructions

Step 1 — Capture the Error Object

Every Supabase SDK call returns a {data, error} tuple. Never assume data exists — always check error first.

import { createClient } from '@supabase/supabase-js'

const supabase = createClient(
  process.env.SUPABASE_URL!,
  process.env.SUPABASE_ANON_KEY!
)

// WRONG — data is null when error exists
const { data } = await supabase.from('todos').select('*')
console.log(data.length) // TypeError: Cannot read property 'length' of null

// CORRECT — always check error first
const { data, error } = await supabase.from('todos').select('*')
if (error) {
  console.error(`[${error.code}] ${error.message}`)
  console.error('Details:', error.details)
  console.error('Hint:', error.hint)
  // error.code tells you the layer:
  //   PGRST* = PostgREST (API gateway)
  //   5-digit numeric = PostgreSQL (database)
  //   AuthApiError = Auth service
  //   StorageApiError = Storage service
  return
}
// Safe to use data here
console.log(`Found ${data.length} rows`)

Troubleshooting: If error is undefined (not null), you may be using an older SDK version. Upgrade to @supabase/supabase-js@2.x or later.

Step 2 — Identify the Error Layer and Code

Match the error code prefix to the correct subsystem, then look up the specific code in the tables below.

PostgREST errors start with PGRST and correspond to API-layer issues (JWT, query parsing, schema). PostgreSQL errors are 5-character codes (e.g., 42501, 23505) from the database engine. Auth errors come as AuthApiError with a human-readable message. Storage errors come as StorageApiError with an HTTP status.

// Diagnostic helper — paste into your codebase to classify errors automatically
function diagnoseSupabaseError(error: { code?: string; message: string; status?: number }) {
  if (!error) return 'No error'

  if (error.code?.startsWith('PGRST')) {
    return `PostgREST error ${error.code}: ${error.message}\n` +
      'Check: JWT validity, column/table names, query syntax'
  }
  if (error.code && /^\d{5}$/.test(error.code)) {
    return `PostgreSQL error ${error.code}: ${error.message}\n` +
      'Check: RLS policies, constraints, schema migrations'
  }
  if (error.message?.includes('AuthApiError')) {
    return `Auth error: ${error.message}\n` +
      'Check: credentials, email confirmation, token expiry'
  }
  if (error.message?.includes('StorageApiError')) {
    return `Storage error: ${error.message}\n` +
      'Check: bucket exists, RLS on storage.objects, file size limits'
  }
  return `Unknown error: ${JSON.stringify(error)}`
}

Troubleshooting: If the error code is empty or missing, check the HTTP status code on the response. A 401 without a code usually means SUPABASE_ANON_KEY is wrong or missing. A 500 without a code usually means a database function threw an unhandled exception.

Step 3 — Apply the Fix and Verify

Once you have identified the error code, apply the corresponding fix from the Error Handling table. Then verify the fix by re-running the original operation.

// Example: Fix PGRST301 (JWT expired)
// Before: stale session causes 401
const { data, error } = await supabase.from('todos').select('*')
// error.code === 'PGRST301'

// Fix: refresh the session, then retry
const { error: refreshError } = await supabase.auth.refreshSession()
if (refreshError) {
  // Token is fully invalid — force re-login
  await supabase.auth.signOut()
  console.error('Session expired. Please sign in again.')
  return
}

// Retry the original query
const { data: retryData, error: retryError } = await supabase.from('todos').select('*')
if (retryError) {
  console.error('Still failing after refresh:', retryError.code, retryError.message)
} else {
  console.log('Fixed! Retrieved', retryData.length, 'rows')
}
// Example: Fix 42501 (RLS policy violation)
// Step A: Confirm RLS is the problem using service role client
const adminClient = createClient(
  process.env.SUPABASE_URL!,
  process.env.SUPABASE_SERVICE_ROLE_KEY!,  // bypasses RLS
  { auth: { autoRefreshToken: false, persistSession: false } }
)
const { data: adminData } = await adminClient.from('todos').select('*')
console.log('Admin sees', adminData?.length, 'rows')  // If this works, RLS is blocking

// Step B: Check which user the JWT resolves to
const { data: { user } } = await supabase.auth.getUser()
console.log('Current auth.uid() =', user?.id)

// Step C: Fix the RLS policy in SQL Editor or migration
/*
  CREATE POLICY "Users can read own todos"
    ON todos FOR SELECT
    USING (auth.uid() = user_id);

  -- Verify with:
  SET request.jwt.claim.sub = '<user-id>';
  SELECT * FROM todos;
*/

// Step D: Retry original query
const { data: fixedData, error: fixedError } = await supabase.from('todos').select('*')
console.log(fixedError ? `Still blocked: ${fixedError.code}` : `Success: ${fixedData.length} rows`)

Troubleshooting: After applying a migration, you may need to reload the PostgREST schema cache. In the Supabase Dashboard, go to Settings > API and click "Reload schema cache", or call NOTIFY pgrst, 'reload schema' in SQL.

Output

Deliverables after applying this skill:

  • Error identified by code and layer (PostgREST, PostgreSQL, Auth, Storage, Realtime)
  • Root cause isolated using the diagnostic helper or manual code inspection
  • Fix applied from the Error Handling table and verified against the original failing operation
  • Guard code in place (if (error) checks) preventing silent null-data bugs

Error Handling

PostgREST API Errors (PGRST*)

CodeHTTPMeaningRoot CauseFix
PGRST301401JWT expired or invalidSUPABASE_ANON_KEY is wrong, or the user session expiredVerify SUPABASE_ANON_KEY matches the project; call supabase.auth.refreshSession()
PGRST302401Missing Authorization headerClient created without a key, or middleware stripped the headerPass SUPABASE_ANON_KEY to createClient(); check proxy/CDN config
PGRST116406No rows returned for .single()Query matched 0 rows but .single() expects exactly 1Use .maybeSingle() for optional lookups, or check filters
PGRST200400Invalid query parametersMalformed filter, bad operator, or invalid column referenceCheck filter syntax: .eq('col', val) not .eq('col = val')
PGRST204400Column not foundColumn name doesn't exist in the table or viewVerify column exists with supabase gen types typescript; check for typos
PGRST000503Connection pool exhaustedToo many concurrent connections from serverless functionsEnable pgBouncer (Supavisor) in project settings; reduce connection count

PostgreSQL Database Errors (5-digit codes)

CodeMeaningRoot CauseFix
42501RLS policy violationRow-level security is blocking the operation for this userAdd or fix the RLS policy; test with service role to confirm
23505Unique constraint violationINSERT/UPDATE conflicts with an existing rowUse .upsert({onConflict: 'column'}) or check existence first
23503Foreign key violationReferenced row doesn't exist in the parent tableInsert the parent row first, or check the foreign key value
42P01Table or relation doesn't existMigration not applied, or wrong schemaRun supabase db push; verify schema with \dt in SQL Editor
42703Column doesn't existSchema out of sync with codeRegenerate types: supabase gen types typescript --local > types/supabase.ts
57014Query cancelled (statement timeout)Query took longer than statement_timeoutAdd indexes; simplify the query; increase timeout in postgresql.conf

Auth Service Errors

Error MessageCauseFix
invalid_credentials / Invalid login credentialsWrong email or passwordVerify credentials; check if email is confirmed
email_not_confirmed / Email not confirmedUser hasn't clicked confirmation linkCheck inbox/spam; for local dev check Inbucket at localhost:54324
user_already_exists / User already registeredDuplicate sign-upCall signInWithPassword() instead of signUp()
Token has expired or is invalidStale magic link or OTPRequest a new magic link or OTP; links expire after 5 minutes by default
AuthRetryableFetchErrorNetwork failure reaching Auth serviceRetry with backoff; verify SUPABASE_URL is correct and reachable

Storage Errors

ErrorCauseFix
Bucket not foundBucket name is wrong or bucket doesn't existCreate the bucket in Dashboard or via migration SQL
The resource already existsUploading to a path that already has a filePass {upsert: true} in upload options to overwrite
new row violates row-level securityStorage RLS blocking the upload/downloadAdd a policy on storage.objects for the operation (INSERT, SELECT, DELETE)
413 Payload Too LargeFile exceeds the bucket's size limitIncrease file_size_limit on the bucket, or use TUS resumable upload for large files

Realtime Errors

SymptomCauseFix
CHANNEL_ERROR on subscribeRealtime not enabled for the tableDashboard > Database > Replication > enable the table; or add it to supabase_realtime publication
TIMED_OUT on subscribeNetwork issue or firewall blocking WebSocketCheck that port 443 WebSocket connections are allowed
No events receivedTable not in Realtime publicationRun: ALTER PUBLICATION supabase_realtime ADD TABLE your_table;
Events stop after deploySchema change drops Realtime connectionsClients auto-reconnect; ensure .subscribe() handles reconnection

Examples

Example 1 — Handling .single() on optional data (PGRST116)

// BAD — crashes when user has no profile
const { data: profile } = await supabase
  .from('profiles')
  .select('*')
  .eq('user_id', userId)
  .single()  // throws PGRST116 if no row exists

// GOOD — returns null instead of erroring
const { data: profile, error } = await supabase
  .from('profiles')
  .select('*')
  .eq('user_id', userId)
  .maybeSingle()

if (!profile) {
  // Create a default profile
  const { data: newProfile } = await supabase
    .from('profiles')
    .insert({ user_id: userId, display_name: 'New User' })
    .select()
    .single()
}

Example 2 — Upsert to avoid unique constraint (23505)

// BAD — fails if row already exists
const { error } = await supabase
  .from('user_settings')
  .insert({ user_id: userId, theme: 'dark' })
// error.code === '23505' — unique constraint on user_id

// GOOD — inserts or updates based on conflict column
const { data, error } = await supabase
  .from('user_settings')
  .upsert(
    { user_id: userId, theme: 'dark' },
    { onConflict: 'user_id' }
  )
  .select()
  .single()

Example 3 — Realtime subscription with error handling

const channel = supabase
  .channel('todos-changes')
  .on(
    'postgres_changes',
    { event: '*', schema: 'public', table: 'todos' },
    (payload) => {
      console.log('Change received:', payload.eventType, payload.new)
    }
  )
  .subscribe((status, err) => {
    switch (status) {
      case 'SUBSCRIBED':
        console.log('Realtime connected')
        break
      case 'CHANNEL_ERROR':
        console.error('Realtime error — is the table in the publication?', err)
        // Fix: ALTER PUBLICATION supabase_realtime ADD TABLE todos;
        break
      case 'TIMED_OUT':
        console.error('Realtime timed out — check network')
        break
      case 'CLOSED':
        console.log('Channel closed')
        break
    }
  })

// Always clean up on unmount / exit
process.on('SIGINT', async () => {
  await supabase.removeChannel(channel)
  process.exit(0)
})

Example 4 — Connection pool exhaustion (PGRST000) in serverless

// BAD — creates a new client per request in serverless (Lambda, Edge Functions)
export async function handler(req: Request) {
  const supabase = createClient(url, key)  // new connection every invocation
  const { data } = await supabase.from('todos').select('*')
  return Response.json(data)
}

// GOOD — reuse client across warm invocations
const supabase = createClient(url, key, {
  auth: { autoRefreshToken: false, persistSession: false }
})

export async function handler(req: Request) {
  const { data, error } = await supabase.from('todos').select('*')
  if (error) {
    if (error.code === 'PGRST000') {
      // Pool exhausted — return 503 so the caller retries
      return new Response('Service temporarily unavailable', { status: 503 })
    }
    return Response.json({ error: error.message }, { status: 400 })
  }
  return Response.json(data)
}

Resources

Next Steps

  • Use supabase-debug-bundle to generate a full diagnostic snapshot when errors persist after applying these fixes.
  • Use supabase-security-basics to audit your RLS policies and prevent 42501 errors proactively.
  • Use supabase-known-pitfalls for edge cases and SDK behavior that can cause subtle bugs.
  • Use supabase-observability to set up logging and alerting so you catch errors before users report them.

平台分布

Claude Code

34.27%
按下载量换算87

OpenCode

24.15%
按下载量换算62

Cursor

19.02%
按下载量换算49

Antigravity

10.18%
按下载量换算26

Gemini CLI

4.55%
按下载量换算12

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills