microsoft / rushstack

Monorepo for tools developed by the Rush Stack community
https://rushstack.io/
Other
5.89k stars 595 forks source link

[rush] When I run rush publish it reports the following error: Maximum call stack size exceeded #4185

Open maki-llll opened 1 year ago

maki-llll commented 1 year ago

Hi, When I run rush publish -a -p, the following error is output:

Starting "rush publish"

Validating package manager shrinkwrap file.

Transforming E:\work\comen-web\eds-chl\comen-web\common\config\rush\.npmrc-publish
  --> "E:\work\comen-web\eds-chl\comen-web\common\temp\publish-home\.npmrc"
Finding changes in: E:\work\comen-web\eds-chl\comen-web\common\changes

ERROR: Maximum call stack size exceeded
Question Answer
@microsoft/rush globally installed version? v5.70.0
Operating system? Windows
Node.js version (node -v)? v14.18.1
dmichon-msft commented 1 year ago

Try running rush --debug publish -a -p? That should at least print the stack trace so we have more to go on

maki-llll commented 1 year ago

Try running rush --debug publish -a -p? That should at least print the stack trace so we have more to go on

Thanks for your reply, I tried it and the following log appeared:

RangeError: Maximum call stack size exceeded
    at Function._addChange (C:\Users\chenhengli\AppData\Roaming\npm\node_modules\@microsoft\rush\node_modules\@microsoft\rush-lib\lib\logic\PublishUtilities.js:377:22)
    at Function._updateDownstreamDependency (C:\Users\chenhengli\AppData\Roaming\npm\node_modules\@microsoft\rush\node_modules\@microsoft\rush-lib\lib\logic\PublishUtilities.js:524:47)
    at Function._updateDownstreamDependencies (C:\Users\chenhengli\AppData\Roaming\npm\node_modules\@microsoft\rush\node_modules\@microsoft\rush-lib\lib\logic\PublishUtilities.js:484:42)
    at Function._updateDownstreamDependency (C:\Users\chenhengli\AppData\Roaming\npm\node_modules\@microsoft\rush\node_modules\@microsoft\rush-lib\lib\logic\PublishUtilities.js:532:42)
    at Function._updateDownstreamDependencies (C:\Users\chenhengli\AppData\Roaming\npm\node_modules\@microsoft\rush\node_modules\@microsoft\rush-lib\lib\logic\PublishUtilities.js:484:42)
    at Function._updateDownstreamDependency (C:\Users\chenhengli\AppData\Roaming\npm\node_modules\@microsoft\rush\node_modules\@microsoft\rush-lib\lib\logic\PublishUtilities.js:532:42)
    at Function._updateDownstreamDependencies (C:\Users\chenhengli\AppData\Roaming\npm\node_modules\@microsoft\rush\node_modules\@microsoft\rush-lib\lib\logic\PublishUtilities.js:484:42)
    at Function._updateDownstreamDependency (C:\Users\chenhengli\AppData\Roaming\npm\node_modules\@microsoft\rush\node_modules\@microsoft\rush-lib\lib\logic\PublishUtilities.js:532:42)
    at Function._updateDownstreamDependencies (C:\Users\chenhengli\AppData\Roaming\npm\node_modules\@microsoft\rush\node_modules\@microsoft\rush-lib\lib\logic\PublishUtilities.js:484:42)
    at Function._updateDownstreamDependency (C:\Users\chenhengli\AppData\Roaming\npm\node_modules\@microsoft\rush\node_modules\@microsoft\rush-lib\lib\logic\PublishUtilities.js:532:42)

This looks like the first parameter of the _addChange method is reporting an error. The changed file path is common/changes/comen-api/eds-chl_2023-06-09-06-40.json and the contents of the changed file are as follows:

{
  "changes": [
    {
      "packageName": "comen-api",
      "comment": "publish test",
      "type": "minor"
    }
  ],
  "packageName": "comen-api"
}
iclanton commented 1 year ago

@maki-llll - Do you have a cycle in your dependency graph? Are you using PNPM workspaces? Can you share a repro?