vercel / examples

Enjoy our curated collection of examples and solutions. Use these patterns to build your own robust and scalable applications.
MIT License
3.61k stars 1.11k forks source link

nx-monorepo example build failed #937

Open moonheekim0118 opened 4 months ago

moonheekim0118 commented 4 months ago

I followed this documentation and got some errors

nx monorepo exmple build failed with theses logs

[23:01:00.758] Running build in Washington, D.C., USA (East) – iad1
[23:01:00.973] Cloning github.com/moonheekim0118/nx-monorepo (Branch: main, Commit: f6398c8)
[23:01:01.574] Previous build cache not available
[23:01:01.753] Cloning completed: 778.829ms
[23:01:01.753] Running "npx nx-ignore app"
[23:01:03.334] npm WARN exec The following package was not found and will be installed: nx-ignore@19.2.0
[23:01:04.483] ≫ Using Nx to determine if this project (app) is affected by the commit...
[23:02:07.452] npm WARN using --force Recommended protections disabled.
[23:02:07.452] npm WARN deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
[23:02:07.452] npm WARN deprecated abab@2.0.6: Use your platform's native atob() and btoa() methods instead
[23:02:07.452] npm WARN deprecated domexception@4.0.0: Use your platform's native DOMException instead
[23:02:07.453] npm WARN deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
[23:02:07.453] npm WARN deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
[23:02:07.453] npm WARN deprecated w3c-hr-time@1.0.2: Use your platform's native performance.now() and performance.timeOrigin.
[23:02:07.453] npm WARN deprecated glob@7.1.4: Glob versions prior to v9 are no longer supported
[23:02:07.453] npm WARN deprecated glob@7.1.7: Glob versions prior to v9 are no longer supported
[23:02:07.453] npm WARN deprecated @humanwhocodes/config-array@0.11.14: Use @eslint/config-array instead
[23:02:07.453] npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
[23:02:08.372] fatal: Not a valid object name HEAD^
[23:02:08.372] fatal: No such ref: 'HEAD^'
[23:02:08.372] nx affected:graph
[23:02:08.372] 
[23:02:08.372] Graph dependencies affected by changes
[23:02:08.373] 
[23:02:08.373] Run command using --base=[SHA1] (affected by the committed, uncommitted and untracked changes):
[23:02:08.373]   --base  Base of the current branch (usually main)  [string]
[23:02:08.373] 
[23:02:08.373] or using --base=[SHA1] --head=[SHA2] (affected by the committed changes):
[23:02:08.373]   --base  Base of the current branch (usually main)  [string]
[23:02:08.373]   --head  Latest commit of the current branch (usually HEAD)  [string]
[23:02:08.373] 
[23:02:08.373] or using:
[23:02:08.374]   --files        Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas  [array]
[23:02:08.374]   --uncommitted  Uncommitted changes  [boolean]
[23:02:08.374]   --untracked    Untracked changes  [boolean]
[23:02:08.374] 
[23:02:08.374] Options:
[23:02:08.374]   --help              Show help  [boolean]
[23:02:08.374]   --version           Show version number  [boolean]
[23:02:08.374]   --file              Output file (e.g. --file=output.json or --file=dep-graph.html)  [string]
[23:02:08.376]   --focus             Use to show the project graph for a particular project and every node that is either an ancestor or a descendant.  [string]
[23:02:08.376]   --exclude           Exclude certain projects from being processed  [array] [default: []]
[23:02:08.376]   --groupByFolder     Group projects by folder in the project graph  [boolean]
[23:02:08.376]   --host              Bind the project graph server to a specific ip address.  [string]
[23:02:08.376]   --port              Bind the project graph server to a specific port.  [number]
[23:02:08.376]   --watch             Watch for changes to project graph and update in-browser  [boolean] [default: false]
[23:02:08.377]   --open              Open the project graph in the browser.  [boolean] [default: true]
[23:02:08.377]   --all               All projects  [boolean]
[23:02:08.377]   --runner            This is the name of the tasks runner configured in nx.json  [string]
[23:02:08.377]   --skip-nx-cache     Rerun the tasks even when the results are available in the cache  [boolean] [default: false]
[23:02:08.377]   --configuration     This is the configuration to use when performing tasks on projects  [string]
[23:02:08.378]   --only-failed       Isolate projects which previously failed  [deprecated: The command to rerun failed projects will appear if projects fail. This now does nothing and will be removed in v15.] [boolean] [default: false]
[23:02:08.378]   --verbose           Prints additional information about the commands (e.g., stack traces)  [boolean] [default: false]
[23:02:08.378]   --nx-bail           Stop command execution after the first failed task  [boolean] [default: false]
[23:02:08.378]   --nx-ignore-cycles  Ignore cycles in the task graph  [boolean] [default: false]
[23:02:08.378] 
[23:02:08.378] Examples:
[23:02:08.379]   affected:graph --files=libs/mylib/src/index.ts             Open the project graph of the workspace in the browser, and highlight the projects affected by changing the index.ts file
[23:02:08.379]   affected:graph --base=main --head=HEAD                     Open the project graph of the workspace in the browser, and highlight the projects affected by the changes between main and HEAD (e.g., PR)
[23:02:08.379]   affected:graph --base=main --head=HEAD --file=output.json  Save the project graph of the workspace in a json file, and highlight the projects affected by the changes between main and HEAD (e.g., PR)
[23:02:08.379]   affected:graph --base=main --head=HEAD --file=output.html  Generate a static website with project graph data in an html file, highlighting the projects affected by the changes between main and HEAD (e.g., PR)
[23:02:08.379]   affected:graph --base=main~1 --head=main                   Open the project graph of the workspace in the browser, and highlight the projects affected by the last commit on main
[23:02:08.380]   affected:graph --exclude=project-one,project-two           Open the project graph of the workspace in the browser, highlight the projects affected, but exclude project-one and project-two
[23:02:08.380] 
[23:02:08.380] Find more information and examples at https://nx.dev/cli/affected-graph
[23:02:08.380] 
[23:02:08.380] Error: Command failed: git merge-base --fork-point "HEAD^" "HEAD"
[23:02:08.380] fatal: No such ref: 'HEAD^'
[23:02:08.380] 
[23:02:08.380]     at genericNodeError (node:internal/errors:984:15)
[23:02:08.381]     at wrappedFn (node:internal/errors:538:14)
[23:02:08.381]     at checkExecSyncError (node:child_process:890:11)
[23:02:08.381]     at execSync (node:child_process:962:15)
[23:02:08.381]     at getFilesUsingBaseAndHead (/vercel/path0/node_modules/nx/src/utils/command-line-utils.js:283:50)
[23:02:08.381]     at parseFiles (/vercel/path0/node_modules/nx/src/utils/command-line-utils.js:252:20)
[23:02:08.381]     at projectsToRun (/vercel/path0/node_modules/nx/src/command-line/affected.js:100:145)
[23:02:08.381]     at Object.<anonymous> (/vercel/path0/node_modules/nx/src/command-line/affected.js:29:26)
[23:02:08.381]     at Generator.next (<anonymous>)
[23:02:08.382]     at fulfilled (/vercel/path0/node_modules/tslib/tslib.js:166:62) {
[23:02:08.382]   status: 128,
[23:02:08.382]   signal: null,
[23:02:08.382]   output: [
[23:02:08.382]     null,
[23:02:08.382]     <Buffer >,
[23:02:08.382]     <Buffer 66 61 74 61 6c 3a 20 4e 6f 20 73 75 63 68 20 72 65 66 3a 20 27 48 45 41 44 5e 27 0a>
[23:02:08.383]   ],
[23:02:08.383]   pid: 242,
[23:02:08.383]   stdout: <Buffer >,
[23:02:08.383]   stderr: <Buffer 66 61 74 61 6c 3a 20 4e 6f 20 73 75 63 68 20 72 65 66 3a 20 27 48 45 41 44 5e 27 0a>
[23:02:08.383] }
[23:02:08.386] 
[23:02:08.386]  >  NX   Nx didn't recognize the following args: file, watch, open
[23:02:08.386] 
[23:02:08.387]    When using '--' all executor args have to be defined after '--'.
[23:02:08.387] 
[23:02:08.387] 
[23:02:08.387] fatal: Not a valid object name HEAD^
[23:02:08.387] fatal: No such ref: 'HEAD^'
[23:02:08.387] nx affected:graph
[23:02:08.387] 
[23:02:08.387] Graph dependencies affected by changes
[23:02:08.387] 
[23:02:08.388] Run command using --base=[SHA1] (affected by the committed, uncommitted and untracked changes):
[23:02:08.388]   --base  Base of the current branch (usually main)  [string]
[23:02:08.388] 
[23:02:08.388] or using --base=[SHA1] --head=[SHA2] (affected by the committed changes):
[23:02:08.388]   --base  Base of the current branch (usually main)  [string]
[23:02:08.388]   --head  Latest commit of the current branch (usually HEAD)  [string]
[23:02:08.388] 
[23:02:08.389] or using:
[23:02:08.389]   --files        Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas  [array]
[23:02:08.389]   --uncommitted  Uncommitted changes  [boolean]
[23:02:08.389]   --untracked    Untracked changes  [boolean]
[23:02:08.389] 
[23:02:08.389] Options:
[23:02:08.389]   --help              Show help  [boolean]
[23:02:08.390]   --version           Show version number  [boolean]
[23:02:08.390]   --file              Output file (e.g. --file=output.json or --file=dep-graph.html)  [string]
[23:02:08.390]   --focus             Use to show the project graph for a particular project and every node that is either an ancestor or a descendant.  [string]
[23:02:08.390]   --exclude           Exclude certain projects from being processed  [array] [default: []]
[23:02:08.390]   --groupByFolder     Group projects by folder in the project graph  [boolean]
[23:02:08.390]   --host              Bind the project graph server to a specific ip address.  [string]
[23:02:08.390]   --port              Bind the project graph server to a specific port.  [number]
[23:02:08.391]   --watch             Watch for changes to project graph and update in-browser  [boolean] [default: false]
[23:02:08.391]   --open              Open the project graph in the browser.  [boolean] [default: true]
[23:02:08.391]   --all               All projects  [boolean]
[23:02:08.391]   --runner            This is the name of the tasks runner configured in nx.json  [string]
[23:02:08.391]   --skip-nx-cache     Rerun the tasks even when the results are available in the cache  [boolean] [default: false]
[23:02:08.391]   --configuration     This is the configuration to use when performing tasks on projects  [string]
[23:02:08.391]   --only-failed       Isolate projects which previously failed  [deprecated: The command to rerun failed projects will appear if projects fail. This now does nothing and will be removed in v15.] [boolean] [default: false]
[23:02:08.391]   --verbose           Prints additional information about the commands (e.g., stack traces)  [boolean] [default: false]
[23:02:08.392]   --nx-bail           Stop command execution after the first failed task  [boolean] [default: false]
[23:02:08.392]   --nx-ignore-cycles  Ignore cycles in the task graph  [boolean] [default: false]
[23:02:08.392] 
[23:02:08.392] Examples:
[23:02:08.392]   affected:graph --files=libs/mylib/src/index.ts             Open the project graph of the workspace in the browser, and highlight the projects affected by changing the index.ts file
[23:02:08.392]   affected:graph --base=main --head=HEAD                     Open the project graph of the workspace in the browser, and highlight the projects affected by the changes between main and HEAD (e.g., PR)
[23:02:08.392]   affected:graph --base=main --head=HEAD --file=output.json  Save the project graph of the workspace in a json file, and highlight the projects affected by the changes between main and HEAD (e.g., PR)
[23:02:08.393]   affected:graph --base=main --head=HEAD --file=output.html  Generate a static website with project graph data in an html file, highlighting the projects affected by the changes between main and HEAD (e.g., PR)
[23:02:08.393]   affected:graph --base=main~1 --head=main                   Open the project graph of the workspace in the browser, and highlight the projects affected by the last commit on main
[23:02:08.393]   affected:graph --exclude=project-one,project-two           Open the project graph of the workspace in the browser, highlight the projects affected, but exclude project-one and project-two
[23:02:08.393] 
[23:02:08.393] Find more information and examples at https://nx.dev/cli/affected-graph
[23:02:08.393] 
[23:02:08.393] Error: Command failed: git merge-base --fork-point "HEAD^" "HEAD"
[23:02:08.393] fatal: No such ref: 'HEAD^'
[23:02:08.394] 
[23:02:08.394]     at genericNodeError (node:internal/errors:984:15)
[23:02:08.394]     at wrappedFn (node:internal/errors:538:14)
[23:02:08.394]     at checkExecSyncError (node:child_process:890:11)
[23:02:08.394]     at execSync (node:child_process:962:15)
[23:02:08.394]     at getFilesUsingBaseAndHead (/vercel/path0/node_modules/nx/src/utils/command-line-utils.js:283:50)
[23:02:08.394]     at parseFiles (/vercel/path0/node_modules/nx/src/utils/command-line-utils.js:252:20)
[23:02:08.394]     at projectsToRun (/vercel/path0/node_modules/nx/src/command-line/affected.js:100:145)
[23:02:08.394]     at Object.<anonymous> (/vercel/path0/node_modules/nx/src/command-line/affected.js:29:26)
[23:02:08.395]     at Generator.next (<anonymous>)
[23:02:08.395]     at fulfilled (/vercel/path0/node_modules/tslib/tslib.js:166:62) {
[23:02:08.395]   status: 128,
[23:02:08.395]   signal: null,
[23:02:08.395]   output: [
[23:02:08.396]     null,
[23:02:08.396]     <Buffer >,
[23:02:08.396]     <Buffer 66 61 74 61 6c 3a 20 4e 6f 20 73 75 63 68 20 72 65 66 3a 20 27 48 45 41 44 5e 27 0a>
[23:02:08.397]   ],
[23:02:08.397]   pid: 242,
[23:02:08.397]   stdout: <Buffer >,
[23:02:08.397]   stderr: <Buffer 66 61 74 61 6c 3a 20 4e 6f 20 73 75 63 68 20 72 65 66 3a 20 27 48 45 41 44 5e 27 0a>
[23:02:08.398] }
[23:02:08.398] 
[23:02:08.398] 🛑 - Build cancelled due to the error above. You may need to use --additional-packages option if using Nx plugins to infer targets e.g. Project Crystal. (Hint: commit with "[nx deploy]" to force deployment if necessary)
[23:02:08.405] The Deployment has been canceled as a result of running the command defined in the "Ignored Build Step" setting.
[23:02:09.348]