dnsimple / dnsimple-node

The DNSimple API client for Node.js.
https://developer.dnsimple.com/
MIT License
48 stars 19 forks source link

Library broken on NodeJS 20 #210

Open kevinroleke opened 3 weeks ago

kevinroleke commented 3 weeks ago

Every endpoint I hit with this client gives this generic error

The "listener" argument must be of type function. Received an instance of Object

Tried with the latest npm version, the latest github release (labelled v8.0.0, v7.4.0 in package.json), and the master branch. All giving this same issue. API works fine over curl or fetch. with the same token & endpoint.

Example usage

    this.client = new DNSimple({
      accessToken: process.env.DNSIMPLE_ACCESS_TOKEN,
    })
    console.log(await this.client.identity.whoami());

   // throws: The "listener" argument must be of type function. Received an instance of Object
ggalmazor commented 1 week ago

Hi @kevinroleke!

Thanks for reporting this bug.

I haven't been able to reproduce the error. This is the script I'm trying:

import {DNSimple} from 'dnsimple'

const client = new DNSimple({
  accessToken: "THE TOKEN",
});

const response = await client.identity.whoami();
console.log(response);

I've tried with NodeJS versions v21.6.2 and v20.15.0, and the dnsimple module version 7.4.0

Could you provide more information about your setup, please?