Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Crashes if `metamask-module-template` already exists in temp directory but is not a Git repo

Open
#19 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
git, typescript
Domain
cli, tooling

Research direction

Start in src/cli.ts at the template-fetching logic around the failing git pull call. Reproduce the case with an existing metamask-module-template directory that lacks .git, then verify that the tool handles that directory appropriately and no longer remains stuck with the fetching spinner.

Written by the indexing model from the issue text.

Description

bug team-wallet-framework wf-bugs

I've tried using both npx @metamask/template-sync and yarn dlx @metamask/template-sync on a project and get the same error:

⠋ Fetching module template.Error: Command failed with exit code 128: git pull
fatal: not a git repository (or any of the parent directories): .git
    at makeError (/private/var/folders/gz/d8jvtc0n0rncp1xz80k0x62m0000gn/T/xfs-cd883ffe/dlx-65796/node_modules/execa/lib/error.js:60:11)
    at handlePromise (/private/var/folders/gz/d8jvtc0n0rncp1xz80k0x62m0000gn/T/xfs-cd883ffe/dlx-65796/node_modules/execa/index.js:118:26)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async task (/private/var/folders/gz/d8jvtc0n0rncp1xz80k0x62m0000gn/T/xfs-cd883ffe/dlx-65796/node_modules/@metamask/template-sync/dist/cli.js:36:21)
    at async main (/private/var/folders/gz/d8jvtc0n0rncp1xz80k0x62m0000gn/T/xfs-cd883ffe/dlx-65796/node_modules/@metamask/template-sync/dist/cli.js:114:9) {
  shortMessage: 'Command failed with exit code 128: git pull',
  command: 'git pull',
  escapedCommand: 'git pull',
  exitCode: 128,
  signal: undefined,
  signalDescription: undefined,
  stdout: '',
  stderr: 'fatal: not a git repository (or any of the parent directories): .git',
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}
⠼ Fetching module template.

It looks like this line is failing. This happens if a metamask-module-template directory already exists in the temporary directory root but is not a Git repository for some reason.

(Also, for some reason, the tool doesn't exit, but the spinner next to "Fetching module template" keeps spinning, but that seems like a separate issue.)

It seems like we ought to check that a .git directory exists in the metamask-module-template directory instead.

Dominant language
TypeScript
Stars
7
Forks
3
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from MetaMask/template-sync

All issues in MetaMask/template-sync

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.