KV & Pages not binding

I had this working previously, but unsure what has changed... I have a remix pages application where in my loader im using a KV store that i had created through the dashboard. Im running await context.env.KV_SITE_CONFIGS.get('ABC123', { type: 'json' }) and my remix app is running fine locally (I have created the .wrangler state files so this works fine locally). But when pushing to either preview or production environments with my command wrangler pages deploy ./public --branch master --commit-hash $CI_COMMIT_HASH --project-name ui-example Ive updated my wrangler so i use the new wrangler.toml which is below. I know its this call to KV that is the issue as removing it allows my application to load. It doesnt give me a good error response though so cannot identify the issue myself and assume its to do with binding issues. Ive already checked my binding IDs are correct and the data in the dashboard is also populated & the pages app is also binded through the dashboard. also running the kv command directly also works fine: wrangler kv:key get ABC123 --binding=KV_SITE_CONFIGS Id really appreciate some ideas please.
name = "ui-example"
compatibility_date = "2024-02-19"

[[kv_namespaces]]
id = "x"
binding = "KV_SITE_CONFIGS"

[[kv_namespaces]]
id = "x"
binding = "KV_THEME_CONFIGS"

[env.production]
compatibility_date = "2024-02-19"

[[env.production.kv_namespaces]]
id = "x"
binding = "KV_SITE_CONFIGS"

[[env.production.kv_namespaces]]
id = "x"
binding = "KV_THEME_CONFIGS"
name = "ui-example"
compatibility_date = "2024-02-19"

[[kv_namespaces]]
id = "x"
binding = "KV_SITE_CONFIGS"

[[kv_namespaces]]
id = "x"
binding = "KV_THEME_CONFIGS"

[env.production]
compatibility_date = "2024-02-19"

[[env.production.kv_namespaces]]
id = "x"
binding = "KV_SITE_CONFIGS"

[[env.production.kv_namespaces]]
id = "x"
binding = "KV_THEME_CONFIGS"
1 Reply
GATES
GATESOP8mo ago
Bump bump
Want results from more Discord servers?
Add your server