Wrangler Automatic resource provisioning not working with vite

I see the news that wrangler now can auto provision resources without specifying resource id in the config file, so I updated wrangler to 4.45.0, and put D1 binding in my wrangler.jsonc
"d1_databases": [
{
"binding": "DB",
"migrations_dir": "drizzle",
"remote": true
}
]
"d1_databases": [
{
"binding": "DB",
"migrations_dir": "drizzle",
"remote": true
}
]
but when I try to run dev server or to deploy I got this error
āœ— pn dev

> .@ dev /home/kuang/projects/blog
> vite dev --port 3000

error when starting dev server:
Error: Processing wrangler.jsonc configuration:
- "d1_databases[0]" bindings must have a "database_id" field but got {"binding":"DB","migrations_dir":"drizzle","remote":true}.
at readConfig (/home/kuang/projects/blog/node_modules/.pnpm/wrangler@4.45.0/node_modules/wrangler/wrangler-dist/cli.js:121404:11)
at readWorkerConfig (file:///home/kuang/projects/blog/node_modules/.pnpm/@cloudflare+vite-plugin@1.13.15_vite@7.1.12_@types+node@22.18.12_jiti@2.6.1_lightningcs_5f4b83851e586ed5c812c54731415fe4/node_modules/@cloudflare/vite-plugin/dist/index.js:15350:17)
āœ— pn dev

> .@ dev /home/kuang/projects/blog
> vite dev --port 3000

error when starting dev server:
Error: Processing wrangler.jsonc configuration:
- "d1_databases[0]" bindings must have a "database_id" field but got {"binding":"DB","migrations_dir":"drizzle","remote":true}.
at readConfig (/home/kuang/projects/blog/node_modules/.pnpm/wrangler@4.45.0/node_modules/wrangler/wrangler-dist/cli.js:121404:11)
at readWorkerConfig (file:///home/kuang/projects/blog/node_modules/.pnpm/@cloudflare+vite-plugin@1.13.15_vite@7.1.12_@types+node@22.18.12_jiti@2.6.1_lightningcs_5f4b83851e586ed5c812c54731415fe4/node_modules/@cloudflare/vite-plugin/dist/index.js:15350:17)
1 Reply
TK
TK•4w ago
Thanks for reporting this! I've just reproduced it with a standard react + vite plugin create cloudflare app with some bindings without resources and I get the same thing as you. I'll bring it up with the team next week šŸ‘ Hey @Zephyrrr - we're aware we have a bug in this where sometimes the flag for the auto provision is not being passed, we're going to try and get that in this week, I'll let you know when that rolls around. Another note on this is that we've decided intentionally to not support 'remote' flagged bindings being created automatically, as our thinking is that you would only use 'remote' if you cared about the data, and wanted to share it, and by its nature not having an ID conflicts with that. However, we are open to discussion on this, so if you have an interesting use case we would love to hear it! Hey @Zephyrrr - update your wrangler version in this project and it should be fixed šŸ˜„

Did you find this page helpful?