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

Missing Cloudflare DB binding (D1), Cache write and read error. #409

Open
yusufalitangoz opened this issue Jan 4, 2025 · 2 comments
Open
Labels
question Further information is requested

Comments

@yusufalitangoz
Copy link

local-storage.json
{ "drizzle-version": "2.0.1", "drizzle-playground": { "state": { "currentFile": "sql", "drizzleValue": null, "sqlValue": null, "showRecordsAsJson": false, "drizzleResult": "{\"json\":null}", "sqlResult": "{\"json\":null}" }, "version": 0 }, "drizzle-global": { "state": { "showCounts": false, "flatSchemas": false, "dataFormats": null }, "version": 0 } }

`WARN "/node_modules/@nuxthub/core/dist/runtime/cache/driver.js" is imported by "virtual:#nitro-internal-virtual/storage", but could not be resolved – treating it as an external dependency.

ERROR (node:16160) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)

ERROR Failed to initialize wrangler bindings proxy write EOF

at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:87:19)
at WriteWrap.callbackTrampoline (node:internal/async_hooks:130:17)

ERROR [nitro] [unhandledRejection] Missing Cloudflare DB binding (D1)

at createError (/node_modules/h3/dist/index.mjs:73:12)
at hubDatabase (node_modules\@nuxthub\core\dist\runtime\database\server\utils\database.js:24:9)
at applyMigrations (node_modules\@nuxthub\core\dist\runtime\database\server\utils\migrations\migrations.js:6:14)
at <anonymous> (node_modules\@nuxthub\core\dist\runtime\database\server\plugins\migrations.dev.js:13:13)
at _function (/node_modules/hookable/dist/index.mjs:133:14)
at /node_modules/hookable/dist/index.mjs:55:57
at /node_modules/hookable/dist/index.mjs:55:47
at Array.map (<anonymous>)
at parallelTaskCaller (/node_modules/hookable/dist/index.mjs:55:28)
at Hookable.callHookWith (/node_modules/hookable/dist/index.mjs:198:20)

ERROR [nitro] [cache] Cache read error. [unstorage] [cloudflare] Invalid binding CACHE: undefined

at getBinding (/node_modules/unstorage/drivers/utils/cloudflare.mjs:9:11)
at getKVBinding (/node_modules/unstorage/drivers/utils/cloudflare.mjs:25:10)
at getItem (/node_modules/unstorage/drivers/cloudflare-kv-binding.mjs:29:23)
at asyncCall (/node_modules/unstorage/dist/shared/unstorage.BqzpVTXx.mjs:9:26)
at Object.getItem (/node_modules/unstorage/dist/index.mjs:151:14)
at get (node_modules\nuxt\node_modules\nitropack\dist\runtime\internal\cache.mjs:30:36)
at <anonymous> (node_modules\nuxt\node_modules\nitropack\dist\runtime\internal\cache.mjs:105:25)
at runNextTicks (node:internal/process/task_queues:65:5)
at listOnTimeout (node:internal/timers:555:9)
at process.processTimers (node:internal/timers:529:7)

ERROR [nitro] [cache] Cache write error. [unstorage] [cloudflare] Invalid binding CACHE: undefined

at getBinding (/node_modules/unstorage/drivers/utils/cloudflare.mjs:9:11)
at getKVBinding (/node_modules/unstorage/drivers/utils/cloudflare.mjs:25:10)
at Object.setItem (/node_modules/unstorage/drivers/cloudflare-kv-binding.mjs:34:23)
at setItem (/node_modules/@nuxthub/core/dist/runtime/cache/driver.js:44:21)
at asyncCall (/node_modules/unstorage/dist/shared/unstorage.BqzpVTXx.mjs:9:26)
at Object.setItem (/node_modules/unstorage/dist/index.mjs:205:13)
at _resolve (node_modules\nuxt\node_modules\nitropack\dist\runtime\internal\cache.mjs:73:40)
at runNextTicks (node:internal/process/task_queues:65:5)
at listOnTimeout (node:internal/timers:555:9)
at process.processTimers (node:internal/timers:529:7)`
@yusufalitangoz
Copy link
Author

This error occurs when running locally, there is no problem in the product environment.

Copy link
Contributor

atinux commented Jan 8, 2025

Could you please provide a repository for me to try as reproduction?

@atinux atinux added the question Further information is requested label Jan 8, 2025 — with Linear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants