vercel / vercel/ncc

Building nodegit fails with missing functions

Open
#1,024 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
9.8k
Forks
326
PR merge metrics
No merged PRs in 30d

Description

It seems like building nodegit package fails to include several function definitions, resulting in built scripts with this module failing.

Steps to reproduce:

  1. Download and extract project.zip
  2. npm install
  3. Run the module normally (node index.js), it should execute normally and print the message of the commit
  4. Compile the project via ncc (npx ncc build)
  5. Run compiled script (node dist/index.js)

BUG: Script will crash with TypeError: repo.getBranchCommit is not a function

As a workaround, you can uncomment three require methods inside provided index.js and perform steps 4-5 again. Build should work this time.

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.

Research direction

Start with the provided project.zip and index.js, run the normal and ncc-built commands, and compare the resulting failure in dist/index.js. Investigate how ncc handles nodegit's required functions, using the three uncommented require methods as the reproduction contrast. Done means npx ncc build produces a dist/index.js that runs and prints the commit message without the workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.