Issue with Wrangler CLI

I am currently publishing my deployment on Cloudflare pages via wrangler CLI. Its working fine… i am able to successfully deploy project on CF Pages. Wrangler CLI command that i use for this is:

CLOUDFLARE_API_TOKEN=apitoken wrangler pages publish ./project --project-name=project --branch=production

Now, an authentication error showed up when i try to publish the same project on different Cloudflare account. Just a different account. When i try to publish, it throws an authentication error. Having a look at the logs, i found that wrangler tries to call the Cloudflare API with previous account id. but i also explicitly provide the new account id in the wrangler command like this:

CLOUDFLARE_ACCOUNT_ID=account-id CLOUDFLARE_API_TOKEN=apitoken wrangler pages publish ./project --project-name=project --branch=production

But it throws an authentication error. I will appreciate if you guys can help.

When i try to give the config file path to Cloudflare Pages like this:

wrangler pages publish --config ./wrangler.toml --project-name=project --branch=branch ./folder’

it throws an error:

Pages does not support wrangler.toml

then how can i pass the configurations?

What configurations are you trying to pass specifically? Pages doesn’t support a config file yet, so almost everything is specified with CLI arguments such as —kv etc.

Commands · Cloudflare Workers docs will be your best reference for this.

2 Likes