ampproject/cloudflare-amp-optimizer

Install fails with error message

sebastianbenz opened this issue · 4 comments

This might be the expected behavior, but I thought I'd document this here:

Need to install the following packages:
  @cloudflare/wrangler
Ok to proceed? (y) y
⬇️   Installing cargo-generate v0.5.0...
🔧   Creating project called `my-worker`...
✨   Done! New project created /Users/sbenz/Projects/my-worker
🕵️  You can find your zone_id in the right sidebar of a zone's overview tab at https://dash.cloudflare.com
🕵️  You can find your account_id in the right sidebar of your account's Workers page
🕵️  You will need to update the following fields in the created wrangler.toml file before continuing:
- account_id
Error: values must be emitted before tables
npm ERR! code 1
npm ERR! path /Users/sbenz/Projects
npm ERR! command failed
npm ERR! command sh -c wrangler "generate" "my-worker" "https://github.com/ampproject/cloudflare-optimizer"

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/sbenz/.npm/_logs/2021-04-14T10_03_16_967Z-debug.log

What command did you run that generated this output?

npx @cloudflare/wrangler generate my-worker https://github.com/ampproject/cloudflare-amp-optimizer

sorry, should've included that.

Strange, that same command works for me:

Screen Shot 2021-04-15 at 10 48 08 AM

This seems like a wrangler bug that could be specific to your setup

I still get the error (OSX, latest wrangler). Seems to be related to how TOML serialises tables. I don't think it's something that we can fix on our side.