matthewmueller / date

Date() for humans
http://matthewmueller.github.io/date/
1.48k stars 88 forks source link

date is undefined: can't import module #98

Closed digimbyte closed 3 years ago

digimbyte commented 3 years ago

Not sure what's wrong, I have a node app and one of the imports uses date.js but it is undefined I have tried const data = require('date') const data = require('datejs') const data = require('date.js')

error line let baseTime = date(messageArray[index - 1]); error message UnhandledPromiseRejectionWarning: ReferenceError: date is not defined

digimbyte commented 3 years ago

Turns out my compiler wasn't compiling correctly, probably caching issues. this is all you need. const date = require('date.js');