Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indexer Build Fails Due to --workspace-concurrency=Infinity Being Passed to tsc #2471

Open
josusanmartin opened this issue Oct 4, 2024 · 2 comments
Labels

Comments

@josusanmartin
Copy link

Disclaimer: This bug report has been produced with chatGPT, however it is accurate to the extent of my understanding.

Description

When running pnpm run build:all to build all packages in the indexer monorepo, the build process fails because the --workspace-concurrency=Infinity flag is being incorrectly passed to the TypeScript compiler (tsc). This flag is intended for pnpm, but it gets propagated down to the tsc command, causing the build to break.

Steps to Reproduce

  1. Clone the dYdX V4 Indexer repository.
  2. Navigate to the indexer directory.
  3. Run the following command:
    pnpm run build:all
  4. Observe the error message.

Expected Behavior

The build should succeed without passing the --workspace-concurrency=Infinity flag to the TypeScript compiler.

Actual Behavior

The build fails with the following error:

> [email protected] build:all /path/to/indexer
> pnpm recursive run build --workspace-concurrency=Infinity

Scope: 18 of 19 workspace projects
packages/dev build$ rm -rf build/ && tsc "--workspace-concurrency=Infinity"
│ error TS5023: Unknown compiler option '--workspace-concurrency=Infinity'.
└─ Failed in 185ms at /path/to/indexer/packages/dev

Proposed Solution

To fix this issue, we need to remove the --workspace-concurrency=Infinity flag from the build:all script in indexer/package.json. The relevant section should be modified as follows:

"scripts": {
  "build:all": "pnpm recursive run build",
  ...
}

Alternatively, if concurrency control is necessary, we can replace Infinity with a more reasonable value, such as 4:

"build:all": "pnpm recursive run build --workspace-concurrency=4",

Environment

  • OS: Ubuntu 22.04
  • Node.js Version: v22.9.0
  • pnpm Version: 9.12.0

Logs

> [email protected] build:all /path/to/indexer
> pnpm recursive run build --workspace-concurrency=Infinity

Scope: 18 of 19 workspace projects
packages/dev build$ rm -rf build/ && tsc "--workspace-concurrency=Infinity"
│ error TS5023: Unknown compiler option '--workspace-concurrency=Infinity'.
└─ Failed in 185ms at /path/to/indexer/packages/dev

Additional Information

The build error is specific to the use of tsc, and it seems that the --workspace-concurrency=Infinity flag is being propagated to all package builds.

Copy link

linear bot commented Oct 4, 2024

@josusanmartin
Copy link
Author

josusanmartin commented Oct 4, 2024

I didn't run into this issue the second time I tried deploying the indexer. I believe that the problem was that the first time that I ran it I didn't have the TypeScript installed. The solution should be installing TypeScript before running the script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant