Error when running npm run build:serve - Repo url not found

Hi! I’m experiencing an unusual error for the first time.
When running npm run build:serve locally, so I can make sure everything is working before deploying on the Pages site, I get the following:
Error while building file “xxx.json”: Repo url not found: https://github.com/xxx/xxx
I’m not sure why it’s even looking for the repo link when building.

  • The URL shown is correct and the repo exists
  • The repository is private (and has to be because this is for a real client)
  • The npm run dev command works without any issues.
  • When I check in the Yext back-end under Deploys, the Page Generation fails (hence why I wanted to run build locally first)

Any ideas what I need to do to get past this?

It turned out to be a configuration issue on my local machine (I have switched computers, that’s why I hadn’t seen this issue before)

Hi Andrea,
I’m having the same issue in my project, can I ask you which configuration you did to solve it?
Thank You in advance

Hi Andrea,

I am also seeing this error. What was your solution?

Figured it out. The repo’s remote url needs to end in .git

before:

❯ git remote -v
origin	https://github.com/MyRepo (fetch)
origin	https://github.com/MyRepo (push)

change remote url with: git remote set-url origin https://github.com/MyRepo.git

after:

❯ git remote -v
origin	https://github.com/MyRepo.git (fetch)
origin	https://github.com/MyRepo.git (push)
2 Likes