Wrangler2 authentication error using wrangler 0.0.0-08e3a49 (beta) and token auth

I remote to a DigitalOcean droplet and develop there, not on my Chromebook. The wrangler version 1 cli authentication works via export CLOUDFLARE_API_TOKEN=

However wrangler2 cli this token-based authentication does not work, there is a new auth system using browser-only: https://blog.cloudflare.com/wrangler-oauth/

There are many issues mentioning this:

With overall tracking on this ticket:

One issue mentioned a possible fix via

npm install -g [email protected]

wrangler login

I was then able to use the browser based authentication.

However, when I ran this:

wrangler dev index.js

Output

✘ [ERROR] No account id found, quitting...

I exported

export CLOUDFLARE_API_TOKEN=********************

But that did not change the error message

I then exported

export CLOUDFLARE_ACCOUNT_ID=********************

And that initially looked good, however you can see the authentication errors below

Output

 ⛅️ wrangler 0.0.0-08e3a49
---------------------------
⬣ Listening at http://localhost:8787
✘ [ERROR] Error on remote worker: ParseError: A request to the Cloudflare API (/accounts/********************/workers/subdomain/edge-preview) failed.

      at throwFetchError
  (/home/tmc/.nvm/versions/node/v16.14.2/lib/node_modules/wrangler/wrangler-dist/cli.js:118061:17)
      at fetchResult
  (/home/tmc/.nvm/versions/node/v16.14.2/lib/node_modules/wrangler/wrangler-dist/cli.js:118034:5)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)
      at async sessionToken
  (/home/tmc/.nvm/versions/node/v16.14.2/lib/node_modules/wrangler/wrangler-dist/cli.js:120660:28)
      at async createPreviewToken
  (/home/tmc/.nvm/versions/node/v16.14.2/lib/node_modules/wrangler/wrangler-dist/cli.js:120678:53)
      at async createWorkerPreview
  (/home/tmc/.nvm/versions/node/v16.14.2/lib/node_modules/wrangler/wrangler-dist/cli.js:120700:17)
      at async start
  (/home/tmc/.nvm/versions/node/v16.14.2/lib/node_modules/wrangler/wrangler-dist/cli.js:121167:16) {
    text: 'A request to the Cloudflare API
  (/accounts/********************/workers/subdomain/edge-preview) failed.',
    notes: [ { text: 'Authentication error [code: 10000]' } ],
    location: undefined,
    kind: 'error',
    code: 10000
  }

Wrangler2 works fine with API authentication, there’s no issues with that which I’ve experienced.

Do you have a screenshot of the permissions you granted to the API token that you’re using?

image

Well, now it is hanging and will time out, but before (an hour ago) it confirmed my access (did not ask me to choose zone or anything)

image

Perhaps the error above was because I took too long taking the screen shot and it timed out

Here, I did it again, it confirms access:

image