Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(d1): throw a better error if binding not found #60

Merged
merged 3 commits into from
Mar 8, 2024

Conversation

atinux
Copy link
Member

@atinux atinux commented Mar 7, 2024

Before:

[nitro] [unhandledRejection] TypeError: Cannot read properties of undefined (reading 'TEST')
    at getDB (file:///Users/atinux/Projects/unjs/nitro/node_modules/.pnpm/db0@0.1.3_better-sqlite3@9.4.3/node_modules/db0/connectors/cloudflare-d1.mjs:2:44)

After:

[nitro] [unhandledRejection] Error: D1 binding TEST not found
    at getDB (file:///Users/atinux/Projects/unjs/db0/connectors/cloudflare-d1.mjs:5:13)
    at Object.prepare (file:///Users/atinux/Projects/unjs/db0/connectors/cloudflare-d1.mjs:13:21)

src/connectors/cloudflare-d1.ts Outdated Show resolved Hide resolved
Copy link

cloudflare-workers-and-pages bot commented Mar 7, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5483a2c
Status:⚡️  Build in progress...

View logs

src/connectors/cloudflare-d1.ts Outdated Show resolved Hide resolved
@pi0 pi0 changed the title chore(d1): throw a better error if binding not found refactor(d1): throw a better error if binding not found Mar 8, 2024
@pi0 pi0 merged commit 2ab001b into main Mar 8, 2024
2 of 3 checks passed
@pi0 pi0 deleted the fix/d1-binding-error branch March 8, 2024 15:12
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.

2 participants