lmammino / tall

Promise-based, No-dependency URL unshortner (expander) module for Node.js
https://lmammino.github.io/tall/
MIT License
72 stars 7 forks source link

TypeError: The "listener" argument must be of type Function. Received type object #48

Open Nsrose opened 2 years ago

Nsrose commented 2 years ago

I can't seem to get this to work. I have installed the package, and I am running nextjs.

Here is my code:

import { tall } from 'tall'; var airbnblink = 'https://abnb.me/YEO24YyMisb'; tall(airbnblink).then(function(response) { console.log(response); }) .catch(function(err) { console.log(err); })

But I can't get this to run - console keeps saying: TypeError: The "listener" argument must be of type Function. Received type object

Any ideas why?

lmammino commented 2 years ago

Are you using this in the fronted or on a next.js API? I doubt this works on the frontend because it uses Node.js http package to do the HTTP requests.

PS: Even if we were to use fetch, you'd most likely run into CORS problems...

chaitanyasanoriya commented 1 year ago

I am also facing this issue. When I tested it in a simple node app, it worked but when I tried to use it in a react app it fails.