You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] node-fetch support broken in v5.4.0 - Cannot read properties of undefined (reading 'substring') #3036
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.
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.
Hi, facing the same issue. This doesn't seem related to changes in the sandbox. I have built v5.3.0 and v5.2.1 locally and faced the same issue. The issue comes when node-fetch tries to check the Node.js version using process.version and it results in undefined
The same goes with axios and undici; those libs also fail but with different errors.
Activity
MuhammadWajidShahid commentedon May 23, 2026
Hi, facing the same issue. This doesn't seem related to changes in the sandbox. I have built v5.3.0 and v5.2.1 locally and faced the same issue. The issue comes when
node-fetchtries to check the Node.js version usingprocess.versionand it results inundefinedThe same goes with axios and undici; those libs also fail but with different errors.