{"uid":"cap_YsHy_B-xfECQ618fhiH3i","slug":"cloudflare-workers-pitfalls-review-d1-opennext-fetch-0bb31a6f","name":"Cloudflare Workers Pitfalls Review (D1, OpenNext, Fetch)","description":"Cloudflare Workers Review: D1, OpenNext, Fetch — Reviews pasted Cloudflare Workers code and configuration (a Worker, a Next.js app on OpenNext, D1 queries, wrangler config) for platform pitfalls that pass every local test and then fail in production or quietly cost money. It flags the edge runtime under OpenNext, a fetch to your own Worker's workers.dev address (error 1042), D1 queries that bind more than 100 parameters as data grows, LIKE patterns over D1's 50-byte limit, reading rowsAffected …","url":"https://api.aiskills402.com/v1/skills/workers-pitfalls-review/file?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET","HEAD"],"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"ok":true,"file":{"name":"SKILL.md","content":"<the SKILL.md file>","encoding":"utf-8"},"name":"Cloudflare Workers Review: D1, OpenNext, Fetch","skill":"workers-pitfalls-review","sha256":"<sha256 of SKILL.md>","receipt":{"tx":"0x<settlement transaction>","settled":true},"version":"1.0.0","redownload":{"url":"<api>/v1/purchases/<token>","token":"<64 hex chars>"}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.05","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.05/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_1wN-GkdTRwMXAZYjfpmH2","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.05","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns a SKILL.md guide identifying production pitfalls in Cloudflare Workers code — covering D1 query limits, OpenNext edge runtime issues, fetch self-loop errors (1042), and wrangler config gotchas.","exampleAgentPrompt":"Can you review my Cloudflare Worker and D1 queries for production pitfalls — things like fetch self-loop errors, D1 parameter limits over 100, LIKE patterns hitting the 50-byte cap, or OpenNext edge runtime issues that only break in production?","exampleUseCases":[{"title":"Pre-deploy D1 query audit","prompt":"I'm about to deploy a Cloudflare Worker that uses D1 with some bulk insert queries — can you check it for pitfalls like binding more than 100 parameters or LIKE patterns that could fail at scale?"},{"title":"OpenNext edge runtime debugging","prompt":"My Next.js app on OpenNext was working in local dev but breaking on Cloudflare — can you review the code and wrangler config for edge runtime issues that wouldn't show up locally?"},{"title":"Fetch self-loop error prevention","prompt":"I wrote a Cloudflare Worker that calls its own workers.dev URL internally, and I keep getting error 1042 — can you review the fetch usage and flag any other production pitfalls while you're at it?"}],"resultDescription":"Returns a SKILL.md file (UTF-8 text) containing a curated, tested guide of Cloudflare Workers production pitfalls — covering D1 parameter binding limits (100+), LIKE pattern length limits (50 bytes), fetch to own workers.dev causing error 1042, OpenNext edge runtime incompatibilities, rowsAffected gotchas, and wrangler config issues. Also includes metadata: skill name, version, SHA256 hash of the file, and a redownload token/URL for future access without repaying.","failureModes":["Payment not settled — 402 response if USDC payment via x402 is not confirmed","Network timeout reaching api.aiskills402.com","Invalid HTTP method — only GET and HEAD are accepted","Empty or malformed input object returns validation error","Service unavailability on provider side returns 5xx"],"whenToPreferThis":"Choose this endpoint when an AI agent or developer needs a ready-made, tested reference guide for Cloudflare Workers production pitfalls — particularly D1 query limits, OpenNext edge runtime issues, and fetch self-loop errors — rather than generic code review. It is especially useful before deploying Workers with D1 at scale, or when debugging prod-only failures that pass local tests. The one-time payment model (with redownload token) makes it cost-effective for repeated agent use.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-27T18:49:59.312Z","isFirstParty":false,"canonicalSlug":"cloudflare-workers-pitfalls-review-d1-opennext-fetch-0bb31a6f"}