#3036·subql

[Bug] `node-fetch` support broken in v5.4.0 - Cannot read properties of undefined (reading 'substring')

Author: 99KiesCreated Apr 6, 2026Updated May 23, 2026

Description
After upgrading to subquerynetwork/subql-node-cosmos:v5.4.0, the previously working node-fetch logic in the project started failing.
Downgrading to v5.3.0 resolves the issue, confirming a regression introduced in v5.4.0.

Error Message

test
2026-04-06T10:22:14.623Z <sandbox-#4> ERROR Indexer revalidate error: Cannot read properties of undefined (reading 'substring')

Environment

  • Indexer image: subquerynetwork/subql-node-cosmos:v5.4.0
  • Working version: v5.3.0

Steps to Reproduce
Make an external API request using node-fetch inside the runtime code of a SubQuery Cosmos project.

Expected Behavior
fetch (or node-fetch) should work as it did in v5.3.0 without throwing substring errors.

Question
How should fetch operations be properly supported in the latest version? Is there a recommended replacement (e.g., native fetch or another approach) for making external API calls in the runtime?


Additional Context
This seems related to changes in the sandbox or runtime environment between v5.3.0 and v5.4.0. Any guidance on the correct migration path would be appreciated.