I was updating my self-answer to Filter out non-contiguous date using momentjs and twix.js and tried to make use of Stack Snippets, but it's not working.
I'm trying to understand if the Moment.js plugin is broken, I'm doing something wrong, or Stack Snippets aren't behaving as intended (or the setup of my work laptop/Internet proxy has broken something else).
The error I get in the snippet console is:
{
"message": "Uncaught TypeError: moment(...).twix is not a function",
"filename": "https://stacksnippets.net/js",
"lineno": 25,
"colno": 43
}
And in the developer console:
Uncaught TypeError: Cannot set properties of undefined (setting '_twix') at Function.Twix._extend (twix.min.js:1) at makeTwix (twix.min.js:1) at twix.min.js:1 at twix.min.js:1
Which, I could have sworn, was not there last night. It might hint this is not a snippet problem.
twix
library also fails to initialise. Throws an error becausefirst
is undefined. But I don't see a good reason it should be right now. EDIT:Twix._extend(moment._locale, { _twix: Twix.defaults });
seems to be a aproblem becausemoment._locale
isundefined
. Perhaps the source ofmoment
needs to include that? Dunno.range.start.unix
being undefined, but that error comes from your code. (I don't know twix.js to know if there should be such a property or not).