Giter Club home page Giter Club logo

Comments (1)

BaptisteMahe avatar BaptisteMahe commented on August 15, 2024

Hello, I have the same issue.
From my research, this behaviour appeared in [email protected].

When I run this command :

$ npx nx affected:build --base="0000000000000000000000000000000000000000" --head="ba25f78f9628a757f1796feb00cd4dd4c2de2c68" --configuration="dev" || echo "Failed"

Output in [email protected]:

$ npx nx affected:build --base="0000000000000000000000000000000000000000" --head="ba25f78f9628a757f1796feb00cd4dd4c2de2c68" --configuration="dev" || echo "Failed"
fatal: bad object 0000000000000000000000000000000000000000
nx affected:build

Run command using --base=[SHA1] (affected by the committed, uncommitted and untracked changes):
      --base  Base of the current branch (usually main)                                                                                                                                                                      [string]

or using --base=[SHA1] --head=[SHA2] (affected by the committed changes):
      --base  Base of the current branch (usually main)                                                                                                                                                                      [string]
      --head  Latest commit of the current branch (usually HEAD)                                                                                                                                                             [string]

or using:
      --files        Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces                                                                  [string]
      --uncommitted  Uncommitted changes                                                                                                                                                                                    [boolean]
      --untracked    Untracked changes                                                                                                                                                                                      [boolean]

Options:
      --help            Show help                                                                                                                                                                                           [boolean]
      --version         Show version number                                                                                                                                                                                 [boolean]
  -c, --configuration   This is the configuration to use when performing tasks on projects                                                                                                                                   [string]
      --output-style    Defines how Nx emits outputs tasks logs                                                                                          [string] [choices: "dynamic", "static", "stream", "stream-without-prefixes"]
      --exclude         Exclude certain projects from being processed                                                                                                                                                        [string]
      --parallel        Max number of parallel processes [default is 3]                                                                                                                                                      [string]
      --runner          This is the name of the tasks runner configured in nx.json                                                                                                                                           [string]
      --graph           Show the task graph of the command. Pass a file path to save the graph data instead of viewing it in the browser.                                                                                    [string]
      --verbose         Prints additional information about the commands (e.g., stack traces)                                                                                                                               [boolean]
      --nxBail          Stop command execution after the first failed task                                                                                                                                 [boolean] [default: false]
      --nxIgnoreCycles  Ignore cycles in the task graph                                                                                                                                                    [boolean] [default: false]
      --skipNxCache     Rerun the tasks even when the results are available in the cache                                                                                                                   [boolean] [default: false]

Examples:
  affected -t custom-target                               Run custom target for all affected projects
  affected -t test --parallel=5                           Run tests in parallel
  affected -t lint test build                             Run lint, test, and build targets for affected projects. Requires Nx v15.4+
  affected -t test --files=libs/mylib/src/index.ts        Run tests for all the projects affected by changing the index.ts file
  affected -t test --base=main --head=HEAD                Run tests for all the projects affected by the changes between main and HEAD (e.g., PR)
  affected -t test --base=main~1 --head=main              Run tests for all the projects affected by the last commit on main
  affected -t=build --exclude='*,!tag:dotnet'             Run build for only projects with the tag `dotnet`
  affected -t build --tag=$NX_TASK_TARGET_PROJECT:latest  Use the currently executing project name in your command.

Find more information and examples at https://nx.dev/nx/affected

Error: Command failed: git diff --name-only --no-renames --relative "0000000000000000000000000000000000000000" "ba25f78f9628a757f1796feb00cd4dd4c2de2c68"
fatal: bad object 0000000000000000000000000000000000000000

    at genericNodeError (node:internal/errors:984:15)
    at wrappedFn (node:internal/errors:538:14)
    at checkExecSyncError (node:child_process:890:11)
    at execSync (node:child_process:962:15)
    at parseGitOutput (/Users/baptistemahe/Documents/repos/unico-workspace/node_modules/nx/src/utils/command-line-utils.js:240:41)
    at getFilesUsingBaseAndHead (/Users/baptistemahe/Documents/repos/unico-workspace/node_modules/nx/src/utils/command-line-utils.js:237:12)
    at parseFiles (/Users/baptistemahe/Documents/repos/unico-workspace/node_modules/nx/src/utils/command-line-utils.js:191:20)
    at getAffectedGraphNodes (/Users/baptistemahe/Documents/repos/unico-workspace/node_modules/nx/src/command-line/affected/affected.js:82:151)
    at Object.affected (/Users/baptistemahe/Documents/repos/unico-workspace/node_modules/nx/src/command-line/affected/affected.js:34:28)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  status: 128,
  signal: null,
  output: [
    null,
    <Buffer >,
    <Buffer 66 61 74 61 6c 3a 20 62 61 64 20 6f 62 6a 65 63 74 20 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 ... 9 more bytes>
  ],
  pid: 22116,
  stdout: <Buffer >,
  stderr: <Buffer 66 61 74 61 6c 3a 20 62 61 64 20 6f 62 6a 65 63 74 20 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 ... 9 more bytes>
}
Failed

Output in [email protected]:

$ npx nx affected:build --base="0000000000000000000000000000000000000000" --head="ba25f78f9628a757f1796feb00cd4dd4c2de2c68" --configuration="dev" || echo "Failed"
fatal: bad object 0000000000000000000000000000000000000000

 NX   Command failed: git diff --name-only --no-renames --relative "0000000000000000000000000000000000000000" "ba25f78f9628a757f1796feb00cd4dd4c2de2c68"

fatal: bad object 0000000000000000000000000000000000000000

Pass --verbose to see the stacktrace.

from nx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.