How to point Worker & NextJs app to the Same Local D1 Clone SQL File
I am using monorepo in my NextJs project
i have 3 folders inside my
1.
2.
3.
now i want my web and worker to use this D1 clone in the shared folder, but it seems thats not possible.
so far i have tried the
its starts the server but throws this error:
Then, when i start my Nextjs server from
and there is not
this is super furstrating
i have 3 folders inside my
apps folder1.
apps/web : my Nextjs Project hosted on cloudflare Pages2.
apps/linkp-worker: my cloudflare worker to assist my main application3.
apps/shared/v3/d1: this is where my local D1 sql clone sitsnow i want my web and worker to use this D1 clone in the shared folder, but it seems thats not possible.
so far i have tried the
--persist-to commandwrangler dev --local --persist-to=../shared ran this inside my worker apps/linkp-workerits starts the server but throws this error:
TypeError: Cannot read properties of undefined (reading 'prepare')Then, when i start my Nextjs server from
bun run dev inside the apps/web it created a .wranger folder inside the web folder and uses its own sql clone, instead of pointing to the shared folderand there is not
--persist-to command for next dev command.this is super furstrating
