Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

moment 2.23.0 breaks moment-timer #26

Open
mxmzb opened this issue Dec 27, 2018 · 9 comments
Open

moment 2.23.0 breaks moment-timer #26

mxmzb opened this issue Dec 27, 2018 · 9 comments

Comments

@mxmzb
Copy link

mxmzb commented Dec 27, 2018

Since moment 2.23.0 there is no timer property on the result of moment.duration(args), which breaks this plugin.

@Kachilero
Copy link

I'm on moment 2.24.0 and this is still an issue.
Is this repo abandoned?

@JohnArcher
Copy link

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 ?

@alvaro-canepa
Copy link

Is there any alternative to this package?

@alvaro-canepa
Copy link

alvaro-canepa commented May 3, 2020

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"
  }

@justbill2020
Copy link
Collaborator

justbill2020 commented Feb 8, 2021

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.

@SeverinDK
Copy link
Owner

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.

@justbill2020
Copy link
Collaborator

Will do, if you need additional contributors I’m totally willing @SeverinDK! Thank you!

@SeverinDK
Copy link
Owner

Will do, if you need additional contributors I’m totally willing @SeverinDK! Thank you!

I have sent you an invite 👍 Welcome aboard!

@JakubChimiak
Copy link

JakubChimiak commented Jul 5, 2022

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants