Uncaught TypeError: Cannot read properties of undefined (reading ‘fn’) at moment-duration-format

I am trying to use moment-duration-format for getting duration.

https://www.npmjs.com/package/moment-duration-format

I am getting error:-

moment-duration-format.js?t=1727769487718&v=a4aab22f:155 Uncaught TypeError: Cannot read properties of undefined (reading 'fn')
    at moment-duration-format.js?t=1727769487718&v=a4aab22f:155:23
    at node_modules/moment-duration-format/lib/moment-duration-format.js (moment-duration-format.js?t=1727769487718&v=a4aab22f:334:7)
    at __require2 (chunk-UP2VWCW5.js?v=a4aab22f:15:50)
    at moment-duration-format.js?t=1727769487718&v=a4aab22f:337:16




Uncaught TypeError: moment.duration(...).format is not a function

I have tried like this:-

app.jsx
===============

import moment from 'moment';
import 'moment-duration-format';


{moment.duration(456, 'seconds').format("h:mm", {
                                            trim: false,
                                        })}


package.json
===================

"dependencies": {
    "moment": "^2.18.1",
    "moment-duration-format": "^1.3.0"
  },