Open mxmzb opened 5 years ago
I'm on moment 2.24.0
and this is still an issue.
Is this repo abandoned?
In my TypeScript project I get the error Only a void function can be called with the 'new' keyword.
Is that the same problem you have, @mxmzb and @Kachilero ?
Is there any alternative to this package?
Solved using my forked version.
Only change dependency version to "moment": "<2.3.0"
.
yarn add https://github.com/alvaro-canepa/moment-timer.git
Edited
A better way to solve this issue. It work for me.
Add this to package.json
and run yarn install --force
.
"resolutions": {
"moment": "~2.24.0"
}
Hey everyone... I just wanted to let everyone know... this works in the browser correctly using momentjs v 2.29.1, it only didn't work in nodejs. I did some research and found that I was not loading momentjs properly in nodejs.
We must use require.js and configure the package correctly to use momentjs in node. per the docs: https://momentjscom.readthedocs.io/en/latest/moment/00-use-it/04-require-js/
I've updated my forked repo and included the current release of momentjs and requirejs in the /example/vendor folder, I also created a nodejs example to illustrate how it functioned correctly.
If you clone my repo, and run node /example/nodejs/index.js
you will see that it functions correctly.
Hope this helps everyone.
Hey everyone... I just wanted to let everyone know... this works in the browser correctly using momentjs v 2.29.1, it only didn't work in nodejs. I did some research and found that I was not loading momentjs properly in nodejs.
We must use require.js and configure the package correctly to use momentjs in node. per the docs: https://momentjscom.readthedocs.io/en/latest/moment/00-use-it/04-require-js/
I've updated my forked repo and included the current release of momentjs and requirejs in the /example/vendor folder, I also created a nodejs example to illustrate how it functioned correctly.
If you clone my repo, and run
node /example/nodejs/index.js
you will see that it functions correctly.Hope this helps everyone.
Feel free to open a Pull Request with these changes. I'll be happy to have a look and merge it into the repo. Have not been paying much attention to this for some time, but see there is still life, so this should be addressed.
Will do, if you need additional contributors I’m totally willing @SeverinDK! Thank you!
Will do, if you need additional contributors I’m totally willing @SeverinDK! Thank you!
I have sent you an invite 👍 Welcome aboard!
Hey everyone... I just wanted to let everyone know... this works in the browser correctly using momentjs v 2.29.1, it only didn't work in nodejs. I did some research and found that I was not loading momentjs properly in nodejs.
We must use require.js and configure the package correctly to use momentjs in node. per the docs: https://momentjscom.readthedocs.io/en/latest/moment/00-use-it/04-require-js/
I've updated my forked repo and included the current release of momentjs and requirejs in the /example/vendor folder, I also created a nodejs example to illustrate how it functioned correctly.
If you clone my repo, and run
node /example/nodejs/index.js
you will see that it functions correctly.Hope this helps everyone.
Hi, for me that seems like not working, Im using moment@2.29.1
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'fn')
Could someone take a look please?
Since moment 2.23.0 there is no timer property on the result of
moment.duration(args)
, which breaks this plugin.