workers-sdk icon indicating copy to clipboard operation
workers-sdk copied to clipboard

🐛 BUG: wrangler pages deploy => Command failed: git rev-parse --abbrev-ref HEAD

Open irvinebroque opened this issue 6 months ago • 0 comments

Which Cloudflare product(s) does this pertain to?

Wrangler

What version(s) of the tool(s) are you using?

3.69.1

What version of Node are you using?

22.3.0

What operating system and version are you using?

Mac OS Sonoma 14.5

Describe the Bug

Steps to reproduce

  1. npm create cloudflare@latest
  2. Create a Next.js app
  3. npm run deploy — attempt to deploy it
  4. Wrangler prompts you — the project does not exist, hit enter, let Wrangler try to create a new project
  5. Observe the error below
⚡️ Build log saved to '.vercel/output/static/_worker.js/nop-build-log.json'
⚡️ Generated '.vercel/output/static/_worker.js/index.js'.
⚡️ Build completed in 0.28s
The project you specified does not exist: "next-node". Would you like to create it?
❯ Create a new project
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

✘ [ERROR] Command failed: git rev-parse --abbrev-ref HEAD

  fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
  Use '--' to separate paths from revisions, like this:
  'git <command> [<revision>...] -- [<file>...]'

I initially reproduced this createing a new app in a subdirectory of an existing git repository. Then, I created a new git repository within this directory. I can still reproduce this error.

It's odd to me that we would fail so hard on wrangler pages deploy — I know that we prompt you for your git repo branch, but if something goes wrong trying to guess at what that is — seems like someone can just enter that themselves?

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

No response

irvinebroque avatar Aug 09 '24 05:08 irvinebroque