pinax-network / substreams-sink

Substreams Sink library
MIT License
4 stars 1 forks source link

error ❌ headers.set is not a function #15

Closed DenisCarriere closed 11 months ago

DenisCarriere commented 1 year ago

Using in https://github.com/pinax-network/substreams-sink-webhook

    // User parameters
    const outputModule = options.moduleName;
    const startBlockNum = options.startBlock;
    const stopBlockNum = options.stopBlock;
    const params = options.params;
    const headers = options.headers;
    const cursorPath = options.cursorPath;
    const productionMode = !options.disableProductionMode;
    // Adding default headers
    headers.set("User-Agent", "substreams-sink");
> substreams-sink-webhook@0.3.5 start
> tsc && node --no-warnings ./dist/bin/cli.js run

file:///Users/denis/Github/substreams-sink-webhook/node_modules/substreams-sink/dist/src/setup.js:33
    headers.set("User-Agent", "substreams-sink");
            ^

TypeError: headers.set is not a function
    at setup (file:///Users/denis/Github/substreams-sink-webhook/node_modules/substreams-sink/dist/src/setup.js:33:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Command.action (file:///Users/denis/Github/substreams-sink-webhook/dist/index.js:9:37)

Node.js v20.5.0
chamorin commented 1 year ago

Fixed in commit: https://github.com/pinax-network/substreams-sink/commit/588865b71ea20593e3359b502c20f4f7c013294e

DenisCarriere commented 11 months ago

Fixed