Skip to content

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

@99Kies

Description

@99Kies

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

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions