Build Requests `account_id` in Wrangler.toml but fails with `account_id`

https://dash.cloudflare.com/ab7347813b21ea6079df4cb18c4bb9e8/pages/view/exchange-traded-fund/952e6991-3192-47dd-9121-12b7bbce5d01

00:30:22.332 ✘ [ERROR] More than one account available but unable to select one in non-interactive mode.
00:30:22.332
00:30:22.332 Please set the appropriate `account_id` in your `wrangler.toml` file.
00:30:22.332 Available accounts are (`<name>`: `<account_id>`):

00:30:22.332 ✘ [ERROR] More than one account available but unable to select one in non-interactive mode.
00:30:22.332
00:30:22.332 Please set the appropriate `account_id` in your `wrangler.toml` file.
00:30:22.332 Available accounts are (`<name>`: `<account_id>`):
https://dash.cloudflare.com/ab7347813b21ea6079df4cb18c4bb9e8/pages/view/exchange-traded-fund/caf73d0b-3b79-4c19-9ce6-e83e33dac0f4
00:31:50.811 Found wrangler.toml file. Reading build configuration...
00:31:50.825
00:31:50.930 ✘ [ERROR] Running configuration file validation for Pages:
00:31:50.930
00:31:50.931 - Configuration file for Pages projects does not support "account_id"
00:31:50.811 Found wrangler.toml file. Reading build configuration...
00:31:50.825
00:31:50.930 ✘ [ERROR] Running configuration file validation for Pages:
00:31:50.930
00:31:50.931 - Configuration file for Pages projects does not support "account_id"
wrangler.toml
name = "echange-traded-fund"
pages_build_output_dir = "./dist"

compatibility_date = "2024-08-01"
compatibility_flags = [ "nodejs_compat" ]

account_id = "***"

[[kv_namespaces]]
binding = "KV"
id = "***"

[[d1_databases]]
binding = "DB"
database_name = "etf"
database_id = "***"
migrations_dir = "./../db/migrations"
name = "echange-traded-fund"
pages_build_output_dir = "./dist"

compatibility_date = "2024-08-01"
compatibility_flags = [ "nodejs_compat" ]

account_id = "***"

[[kv_namespaces]]
binding = "KV"
id = "***"

[[d1_databases]]
binding = "DB"
database_name = "etf"
database_id = "***"
migrations_dir = "./../db/migrations"
build command npm run build && npx wrangler d1 migrations apply etf
7 Replies
jjjrmy
jjjrmyOP4mo ago
@Walshy | Deploying
Walshy
Walshy4mo ago
We have been discussing this internally and account_id should be supported soon 🙂
jjjrmy
jjjrmyOP4mo ago
:soontm: @Walshy | Deploying so how do I deploy my migrations? the answer always seems "don't use Pages"
Walshy
Walshy4mo ago
you shouldn't need the account_id for migrations CLOUDFLARE_ACCOUNT_ID should still work alternatively, wait for it to be supported soon
jjjrmy
jjjrmyOP4mo ago
set that in my secrets? it says I need account Id because I have multiple accounts
Walshy
Walshy4mo ago
if you're running this in ci build thean yeah secrets/env vars
jjjrmy
jjjrmyOP4mo ago
it makes you select an account on npx wrangler d1 migrations apply I'm doing it as a build script npm run build && npx wrangler d1 migrations apply <db_name> looks like that works 👍🏼
Want results from more Discord servers?
Add your server