millify: millify is not a function

I’m using this in a discord bot. My code is below

const millify = require("millify");

    const views = millify(npsong.views);
    const like = millify(npsong.likes);
    const lislikes = millify(npsong.dislikes);

I’m getting the error millify is not a function

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (8 by maintainers)

Commits related to this issue

Most upvoted comments

Please use semver-major version number changes if you change the way the library needs to be imported! This broke my code again 😦

Yea, thanks for the update. Now everything is working perfectly. No default needs

@L0SER8228 Please change your code to this:

const { millify } = require("millify"); // v3.4.0

const views = millify(npsong.views);
const like = millify(npsong.likes);
const lislikes = millify(npsong.dislikes);

Let me know if this works for you.

@L0SER8228 I’ve verified this does indeed work in Node 14 and millify@3.4.0, so the problem must be in your codebase. Check that your code matches what I suggested above (no default needed). Good luck!