Cannot Interact with D1 Locally on Cloudflare Pages

Hi I'm currently facing an issue, i'm getting an error D1_ERROR: no such table: But if I publish the project and access it, it works. I don't know if I'm missing something. I have a wrangler.toml file in my pages, that connect the D1. Would appreciate if anyone could share how to fix it!
6 Replies
Manuel Ogomigo
Manuel OgomigoOP•7mo ago
Trying to debug it, on the local dev returning on tables it shows this { "success": true, "meta": { "served_by": "miniflare.db", "duration": 0, "changes": 0, "last_row_id": 0, "changed_db": false, "size_after": 8192, "rows_read": 1, "rows_written": 0 }, "results": [ { "name": "_cf_KV" } ] } but when I run this on my live it returns this. The tables are working on my live but not showing on local dev. { "success": true, "meta": { "served_by": "v3-prod", "duration": 0.298, "changes": 0, "last_row_id": 0, "changed_db": false, "size_after": 212992, "rows_read": 32, "rows_written": 0 }, "results": [ { "name": "_cf_KV" }, { "name": "Users" }, { "name": "Domains" } ] }
Evil Morty
Evil Morty•7mo ago
GitHub
GitHub - leaysgur/cfw-bindings-wrangler-bridge: This bridge makes i...
This bridge makes it possible to interact with remote Cloudflare Workers bindings(like KV, D1, etc...) from anywhere you want. - leaysgur/cfw-bindings-wrangler-bridge
Manuel Ogomigo
Manuel OgomigoOP•7mo ago
couldn't get it to work, getting error Wrong usage of bridge worker. Required headers are not presented.
Adi
Adi•7mo ago
Hey 👋 Could you share what framework you're using on CF Pages? I've had this work flawlessly for me in Remix for a while.
Manuel Ogomigo
Manuel OgomigoOP•7mo ago
I'm not usingg any framework, just html, css, and js
Adi
Adi•7mo ago
Ahh, ok not really sure what the process is to setup interactions without a framework. I know frameworks like remix use getPlatformProxy internally to communicate with wrangler and Miniflare - https://developers.cloudflare.com/workers/wrangler/api/#getplatformproxy
Cloudflare Docs
API · Cloudflare Workers docs
A set of programmatic APIs that can be integrated with local Cloudflare Workers-related workflows.
Want results from more Discord servers?
Add your server