Skip to content

fix(graphql): pin into-stream to v6 so the pkg build works on Node 20#7

Closed
mgrabina wants to merge 1 commit into
masterfrom
fix/graphql-into-stream-esm
Closed

fix(graphql): pin into-stream to v6 so the pkg build works on Node 20#7
mgrabina wants to merge 1 commit into
masterfrom
fix/graphql-into-stream-esm

Conversation

@mgrabina

Copy link
Copy Markdown

Problem

core/build.rs builds the embedded GraphQL server with @yao-pkg/pkg at compile time. pkg does require("into-stream") (CommonJS), but into-stream >= 7 is ESM-only, so on Node 20+ the build fails:

Error [ERR_REQUIRE_ESM]: require() of ES Module .../into-stream/index.js
from .../@yao-pkg/pkg/lib-es5/producer.js not supported.

Because build.rs runs this during cargo build, it breaks the build for every rindexer consumer on a current Node — not just users of the embedded GraphQL server. The committed graphql/package-lock.json even resolves into-stream to 9.x, so npm ci hits it too. Bumping @yao-pkg/pkg to latest does not help (it still require()s into-stream).

Fix

Pin into-stream to 6 (its last CommonJS release) via an npm overrides in graphql/package.json, and regenerate graphql/package-lock.json. pkg can require() a CommonJS module fine.

Verified

  • npm run build (the exact pkg invocation from build.rs) now produces the binary instead of crashing with ERR_REQUIRE_ESM.
  • A downstream Rust backend compiles against rindexer 0.40 end to end — cargo build runs the graphql build successfully with no skip flag or workaround.

The same issue exists upstream in joshstevens19/rindexer; a matching override there keeps future fork syncs clean.

@yao-pkg/pkg require()s into-stream as CommonJS, but into-stream >=7 is
ESM-only, so the pkg build fails with ERR_REQUIRE_ESM on Node 20+. core/build.rs
runs this at compile time, which breaks `cargo build` for every rindexer
consumer. Pin into-stream to v6 (last CommonJS release) via an npm override and
regenerate the lockfile.
@linear-code

linear-code Bot commented Jun 12, 2026

Copy link
Copy Markdown

SDK-888

@mgrabina mgrabina closed this Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants