feat: added monorepo build error handling#810
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughDocumentation updates removing Injective network from supported networks lists across HyperRPC and HyperSync, adding Fantom support to HyperSync, updating the supported-networks.json configuration, and adding troubleshooting guidance for using Envio in monorepo environments with pnpm workspaces. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/HyperIndex/Troubleshoot/common-issues.md`:
- Line 46: The manual Table of Contents is missing a nested entry for the new
subsection "Using Envio inside a monorepo"; update the in-page TOC (the
markdown/HTML TOC block that lists "PNPM version compatibility" and "Runtime
Issues") to insert a nested entry labeled "Using Envio inside a monorepo" under
the appropriate parent (likely between "PNPM version compatibility" and "Runtime
Issues") so the TOC links to the "Using Envio inside a monorepo" heading.
- Around line 50-60: The documented fix for pnpm-workspace.yaml is wrong because
pnpm only treats matched directories as workspace packages if they also contain
a package.json; update the instructions in the pnpm-workspace.yaml section to
state that adding "envio-indexer/generated" to the packages list alone won't
work unless envio-indexer/generated contains a package.json, and instead
recommend one of three correct approaches: use a negated glob to exclude the
generated dir (e.g., add "!envio-indexer/generated" to the packages list), move
the generated output outside workspace globs, or make envio-indexer/generated a
real workspace package by adding its own package.json; reference
pnpm-workspace.yaml, the packages list, and envio-indexer/generated so readers
can locate the lines to change.
In `@docs/HyperSync/hypersync-supported-networks.md`:
- Line 58: Add a Fantom Testnet row to the Supported Networks table to mirror
the canonical manifest entry (supported-networks.json → fantom-testnet); create
a row labeled "Fantom Testnet" with chain ID 4002 and the same URL pattern as
the Fantom mainnet row (e.g., https://fantom-testnet.hypersync.xyz or
https://4002.hypersync.xyz for the explorer-style column and
https://fantom-testnet.rpc.hypersync.xyz or https://4002.rpc.hypersync.xyz for
the RPC column), and use an appropriate testnet indicator emoji so the table
matches the manifest entry for fantom-testnet.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: b9a90868-1989-49fa-9ea4-ecdbbf8b171f
📒 Files selected for processing (4)
docs/HyperIndex/Troubleshoot/common-issues.mddocs/HyperRPC/hyperrpc-supported-networks.mddocs/HyperSync/hypersync-supported-networks.mdsupported-networks.json
💤 Files with no reviewable changes (2)
- supported-networks.json
- docs/HyperRPC/hyperrpc-supported-networks.md
|
|
||
| > **Important:** Always run `pnpm codegen` immediately after cloning an indexer repository using Envio. | ||
|
|
||
| ### Using Envio inside a monorepo |
There was a problem hiding this comment.
Update the manual TOC for this new section.
This subsection is new, but the Table of Contents still jumps from PNPM version compatibility to Runtime Issues. Please add a nested entry for “Using Envio inside a monorepo” so the in-page navigation stays accurate.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@docs/HyperIndex/Troubleshoot/common-issues.md` at line 46, The manual Table
of Contents is missing a nested entry for the new subsection "Using Envio inside
a monorepo"; update the in-page TOC (the markdown/HTML TOC block that lists
"PNPM version compatibility" and "Runtime Issues") to insert a nested entry
labeled "Using Envio inside a monorepo" under the appropriate parent (likely
between "PNPM version compatibility" and "Runtime Issues") so the TOC links to
the "Using Envio inside a monorepo" heading.
| **Cause:** `pnpm-workspace.yaml` doesn't include both your indexer root and its generated output directory. | ||
|
|
||
| **Solution:** Add both `<envio-indexer>` and `<envio-indexer>/generated` to the `packages` list in `pnpm-workspace.yaml`, for example: | ||
|
|
||
| ```yaml | ||
| packages: | ||
| - "apps/*" | ||
| - "packages/*" | ||
| - "envio-indexer" | ||
| - "envio-indexer/generated" | ||
| ``` |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
Does pnpm only treat directories matched by pnpm-workspace.yaml packagesglobs as workspace packages when they contain apackage.json? How should generated directories without a package.json be handled in pnpm workspaces?
💡 Result:
Yes—pnpm only treats directories that both (a) match pnpm-workspace.yaml packages globs and (b) contain a package.json as workspace packages. Directories that match the glob but don’t have a package.json are not valid workspace packages and should be avoided because they commonly cause confusion (some tooling even flags it as an error condition). [1]
How to handle generated directories without a package.json:
- Exclude them from the workspace globs using negated patterns in
pnpm-workspace.yaml(recommended), e.g.!**/dist/**,!**/.generated/**. pnpm explicitly supports include/exclude globbing inpackages. [2] - Or move generated output outside the directories matched by your
packagesglobs. [1]
If the generated directory is intended to be a workspace package (i.e., you want pnpm to link it / run recursive commands in it), then it needs its own package.json. [1]
Sources:
[1] Vercel conformance rule explaining that workspace-glob-matched directories must contain package.json and recommending exclude/move/convert-to-package fixes. (vercel.com)
[2] pnpm docs showing pnpm-workspace.yaml packages supports include/exclude (negated) globs. (dimava.github.io)
Citations:
- 1: https://vercel.com/docs/conformance/rules/WORKSPACE_MISSING_PACKAGE_JSON?utm_source=openai
- 2: https://dimava.github.io/pnpm/6.x/pnpm-workspace_yaml/
The documented pnpm-workspace.yaml solution is incorrect and will not resolve the issue.
pnpm only recognizes directories as workspace packages if they both match packages globs AND contain a package.json. Adding envio-indexer/generated to the packages list without a package.json in that directory will have no effect.
For generated directories, use one of these approaches instead:
- Exclude the generated directory from workspace globs using negated patterns:
packages: - "apps/*" - "packages/*" - "envio-indexer" - "!envio-indexer/generated"
- Move generated output outside the workspace directories.
- If
generated/should be a workspace package, ensure it contains its ownpackage.json.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@docs/HyperIndex/Troubleshoot/common-issues.md` around lines 50 - 60, The
documented fix for pnpm-workspace.yaml is wrong because pnpm only treats matched
directories as workspace packages if they also contain a package.json; update
the instructions in the pnpm-workspace.yaml section to state that adding
"envio-indexer/generated" to the packages list alone won't work unless
envio-indexer/generated contains a package.json, and instead recommend one of
three correct approaches: use a negated glob to exclude the generated dir (e.g.,
add "!envio-indexer/generated" to the packages list), move the generated output
outside workspace globs, or make envio-indexer/generated a real workspace
package by adding its own package.json; reference pnpm-workspace.yaml, the
packages list, and envio-indexer/generated so readers can locate the lines to
change.
| | Cyber | 7560 | https://cyber.hypersync.xyz or https://7560.hypersync.xyz | https://cyber.rpc.hypersync.xyz or https://7560.rpc.hypersync.xyz | 🪨 | | ||
| | Eth Traces | 1 | https://eth-traces.hypersync.xyz or https://1-traces.hypersync.xyz | https://eth-traces.rpc.hypersync.xyz or https://1-traces.rpc.hypersync.xyz | 🏅 | | ||
| | Ethereum Mainnet | 1 | https://eth.hypersync.xyz or https://1.hypersync.xyz | https://eth.rpc.hypersync.xyz or https://1.rpc.hypersync.xyz | 🏅 | | ||
| | Fantom | 250 | https://fantom.hypersync.xyz or https://250.hypersync.xyz | https://fantom.rpc.hypersync.xyz or https://250.rpc.hypersync.xyz | 🪨 | |
There was a problem hiding this comment.
Add the matching Fantom Testnet row.
Line 58 adds Fantom mainnet, but the canonical supported-networks.json already includes supported-networks/fantom-testnet too. Leaving it out here makes this “Supported Networks” page incomplete relative to the source-of-truth manifest.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@docs/HyperSync/hypersync-supported-networks.md` at line 58, Add a Fantom
Testnet row to the Supported Networks table to mirror the canonical manifest
entry (supported-networks.json → fantom-testnet); create a row labeled "Fantom
Testnet" with chain ID 4002 and the same URL pattern as the Fantom mainnet row
(e.g., https://fantom-testnet.hypersync.xyz or https://4002.hypersync.xyz for
the explorer-style column and https://fantom-testnet.rpc.hypersync.xyz or
https://4002.rpc.hypersync.xyz for the RPC column), and use an appropriate
testnet indicator emoji so the table matches the manifest entry for
fantom-testnet.
|
Please avoid pushing the network changes, it runs in the build and clutters prs
|
Added some info on have an indexer in a monorepo
Summary by CodeRabbit
Documentation
Network Support