If moment is not a peer dependency, it can end up installing its own moment in its node_modules, which is the one it extends, but not the one that is returned by require('moment') in the application code.
This affected my builds both in Node and Webpack'd browser builds. Peer dependency fixed it.
Notably: you won't see the problem if moment is installed first, as npm can notice and not re-install, but this is not guaranteed. Installing twix, then moment should yield the issue.
If moment is not a peer dependency, it can end up installing its own
moment
in itsnode_modules
, which is the one it extends, but not the one that is returned byrequire('moment')
in the application code.This affected my builds both in Node and Webpack'd browser builds. Peer dependency fixed it.
Notably: you won't see the problem if
moment
is installed first, asnpm
can notice and not re-install, but this is not guaranteed. Installingtwix
, thenmoment
should yield the issue.