Closed mflorea closed 6 years ago
We'll release a new version (v1.1.0
via npm) today - could you please check once it's out if you see the same behaviour? This would be awesome 👍
I can confirm that with 1.1.0 moment-jdateformatparser
this issue is still valid. As already pointed out by @mflorea the problem is the use of the require callback in lines 184-186 of moment-jdateformatparser.js
. By using asynchronous require you get a race condition as moment
might already be used before hookMoment
is executed.
Should be fixed by #27, #29 in version 1.2.1
.
I'm using the following code to load
moment-jdateformatparser
:This fails from time to time complaining that
toMomentFormatString
is not available. It happens most often on IE11. The issue is thatmoment-jdateformatparser
extendsmoment
using a Require.js callback when require is available (even if moment was previously loaded). Require.js doesn't call the callback immediately but on the next processor cycle (think about setTimeout(0)) even if the required module is already loaded. Thus you have to do this to make it work, which is cumbersome: