Skip to content

Bug: node-fetch, request is not a function #173

@hzz780

Description

@hzz780

Description

nodejs.TypeError: request is not a function
    at HttpProvider.requestSendByFetch (/opt/workspace/aelf-block-api/node_modules/aelf-sdk/dist/aelf.cjs.js:41995:14)
    at HttpProvider.sendAsyncByFetch (/opt/workspace/aelf-block-api/node_modules/aelf-sdk/dist/aelf.cjs.js:42015:33)
    at HttpProvider.sendAsync (/opt/workspace/aelf-block-api/node_modules/aelf-sdk/dist/aelf.cjs.js:42103:32)
    at RequestManager.sendAsync (/opt/workspace/aelf-block-api/node_modules/aelf-sdk/dist/aelf.cjs.js:41875:28)
    at ChainMethod.run (/opt/workspace/aelf-block-api/node_modules/aelf-sdk/dist/aelf.cjs.js:40028:34)

Steps To Reproduce

const aelf = new AElf(new AElf.providers.HttpProvider('https://aelf-public-node.aelf.io', 8000, {}, requestOptions));

async function main() {
  const status = await aelf.chain.getChainStatus();
  console.log('status: ', status);
}
main();

Current Behavior

Expected Behavior

  • getChainStatus is ok

Environment

  • Node: v20.9.0

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions