Saturday 8 April 2017

'moment is not defined' error - due to upgrade to node v6.10.2?

I recently upgrade my node..js function to v6.10.2 and suddenly my use of 'moment' has stopped working and I get the above error. I have not changed the code in the file that is throwing the error at all. Code snippet is:

                <div class="col-md-4 date">
                     <%= moment(comment.created).fromNow()%>
                </div>

And I require moment in both my app.js and my route file which accesses this page as follow:

moment                  =       require("moment"),

Is this a version issue?



via DaveB1

No comments:

Post a Comment