Remote bindings not using preview D1 DB

I've setup the following, however for some reason the DB is pointing to my production D1 DB instead of my second one (I created a second as a preview). Any ideas why? I run bun dev wrangler.jsonc
"d1_databases": [
{
"binding": "DB",
"database_name": "procity-core",
"database_id": "uuid-1",
"preview_database_id": "uuid-2",
"experimental_remote": true
}
"d1_databases": [
{
"binding": "DB",
"database_name": "procity-core",
"database_id": "uuid-1",
"preview_database_id": "uuid-2",
"experimental_remote": true
}
and vite.config.ts
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { cloudflare } from "@cloudflare/vite-plugin";

export default defineConfig({
plugins: [
react(),
cloudflare({
configPath: "./wrangler.jsonc",
experimental: {
remoteBindings: true,
},
}),
]
});
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { cloudflare } from "@cloudflare/vite-plugin";

export default defineConfig({
plugins: [
react(),
cloudflare({
configPath: "./wrangler.jsonc",
experimental: {
remoteBindings: true,
},
}),
]
});
my package.json has these scripts
"scripts": {
"start": "wrangler dev --remote",
"dev": "vite",
"build": "tsc && vite build",
"preview": "bun run build && vite preview",
"deploy": "bun run build && wrangler deploy",
"schema-gen": "drizzle-kit generate:sqlite",
"lint": "eslint . --ext .ts,.tsx"
}
"scripts": {
"start": "wrangler dev --remote",
"dev": "vite",
"build": "tsc && vite build",
"preview": "bun run build && vite preview",
"deploy": "bun run build && wrangler deploy",
"schema-gen": "drizzle-kit generate:sqlite",
"lint": "eslint . --ext .ts,.tsx"
}
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?