HackMyResume icon indicating copy to clipboard operation
HackMyResume copied to clipboard

Building issue with moment js

Open abelrgr opened this issue 8 years ago • 2 comments

When I was trying to build the resume I'm getting this error and cannot continue:

$ hackmyresume build resume.json to out/out.all

*** HackMyResume v1.8.0 ***
Reading JRS resume: resume.json
Converting resume.json to FRESH format.
Applying MODERN theme (8 formats)
Deprecation warning: moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.
Arguments: [object Object]
Error
    at Function.createFromInputFallback (/usr/local/lib/node_modules/hackmyresume/node_modules/moment/moment.js:285:105)
    at configFromString (/usr/local/lib/node_modules/hackmyresume/node_modules/moment/moment.js:2015:32)
    at configFromInput (/usr/local/lib/node_modules/hackmyresume/node_modules/moment/moment.js:2375:13)
    at prepareConfig (/usr/local/lib/node_modules/hackmyresume/node_modules/moment/moment.js:2358:13)
    at createFromConfig (/usr/local/lib/node_modules/hackmyresume/node_modules/moment/moment.js:2325:44)
    at createLocalOrUTC (/usr/local/lib/node_modules/hackmyresume/node_modules/moment/moment.js:2412:16)
    at local__createLocal (/usr/local/lib/node_modules/hackmyresume/node_modules/moment/moment.js:2416:16)
    at utils_hooks__hooks (/usr/local/lib/node_modules/hackmyresume/node_modules/moment/moment.js:16:29)
    at FluentDate.fmt (/usr/local/lib/node_modules/hackmyresume/dist/core/fluent-date.js:83:14)
    at /usr/local/lib/node_modules/hackmyresume/dist/core/fresh-resume.js:490:29

abelrgr avatar Aug 29 '16 14:08 abelrgr

I am having the same issue!

Sorry if this is presumptuous of me to suggest this fix, but I figured why not! Was getting this error:

Deprecation warning: moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info. Arguments: [object Object] Error at Function. (/usr/local/lib/node_modules/hackmyresume/node_modules/moment/moment.js:285:105) at configFromString (/usr/local/lib/node_modules/hackmyresume/node_modules/moment/moment.js:2015:32) at configFromInput (/usr/local/lib/node_modules/hackmyresume/node_modules/moment/moment.js:2375:13) at prepareConfig (/usr/local/lib/node_modules/hackmyresume/node_modules/moment/moment.js:2358:13) at createFromConfig (/usr/local/lib/node_modules/hackmyresume/node_modules/moment/moment.js:2325:44) at createLocalOrUTC (/usr/local/lib/node_modules/hackmyresume/node_modules/moment/moment.js:2412:16) at local__createLocal (/usr/local/lib/node_modules/hackmyresume/node_modules/moment/moment.js:2416:16) at utils_hooks__hooks (/usr/local/lib/node_modules/hackmyresume/node_modules/moment/moment.js:16:29) at FluentDate.fmt (/usr/local/lib/node_modules/hackmyresume/dist/core/fluent-date.js:83:14) at /usr/local/lib/node_modules/hackmyresume/dist/core/fresh-resume.js:490:29

Looked it up on stack overflow, which suggested to just create a JS object and pass it in.

I locally just made the changes because I haven't really contributed to open source before and figured it was presumptuous to do a pull request so my fix is just: mt = moment(new Date(dt)); instead of mt = moment(dt) in the /dist/core/fluent-date.js file on line 83. Not sure if this is the fix the creators want so, I'm just leaving this message

davzaman avatar Aug 30 '16 23:08 davzaman

Thanks @0bot for the report and @davzaman for the suggested fix! The project was in a bit of a pause when you commented. This will need to be re-verified for v1.9.0 (which should be out shortly) as there have been a lot of changes.

hacksalot avatar Feb 02 '18 01:02 hacksalot