Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: [object Object] #99

Closed
DaveTacker opened this issue Jan 8, 2016 · 20 comments
Closed

ERROR: [object Object] #99

DaveTacker opened this issue Jan 8, 2016 · 20 comments

Comments

@DaveTacker
Copy link

I've just updated hackmyresume and I'm attempting to generate a pdf using the shell theme:

dave@Dave-MacBookAir:~/Downloads$ hackmyresume build resume.json to resumetwo.pdf -t node_modules/jsonresume-theme-slick

*** HackMyResume v1.5.0 ***
Reading resume: resume.json
Applying JSONRESUME-THEME-SLICK theme (2 formats)
Generating PDF  resume: resumetwo.pdf
ERROR: [object Object]
The JSONRESUME-THEME-SLICK theme says: "For 
best results view JSON Resume themes over a local or remote 
HTTP connection. For example:

    http-server <resume-folder>

For more information, see the README."

edit: building an .html file works without any issues.

@hacksalot
Copy link
Owner

Hi @kneeki, thanks for the report -- this looks to be caused by HMR's incorrect handling of missing or irregular resume section data. See also #93. As a sanity test, are you able to run hackmyresume new test.json followed by hackmyresume build test.json to test.pdf -t node_modules/jsonresume-theme-slick?

@DaveTacker
Copy link
Author

Hi @hacksalot,

It doesn't look like it:

dave@Dave-MacBookAir:~/Downloads$ hackmyresume new test.json

*** HackMyResume v1.5.0 ***
Creating new FRESH resume: test.json
dave@Dave-MacBookAir:~/Downloads$ hackmyresume build test.json to test.pdf -t node_modules/jsonresume-theme-slick

*** HackMyResume v1.5.0 ***
Reading resume: test.json
Applying JSONRESUME-THEME-SLICK theme (2 formats)
Generating PDF  resume: test.pdf
ERROR: [object Object]
The JSONRESUME-THEME-SLICK theme says: "For 
best results view JSON Resume themes over a local or remote 
HTTP connection. For example:

    http-server <resume-folder>

For more information, see the README."
dave@Dave-MacBookAir:~/Downloads$ 

@hacksalot
Copy link
Owner

Thanks, good to know. One last question, are you able to run hackmyresume analyze resume.json on your actual resume?

@DaveTacker
Copy link
Author

Sure thing:

dave@Dave-MacBookAir:~/Downloads$ hackmyresume analyze resume.json

*** HackMyResume v1.5.0 ***
Reading resume: resume.json
Analyzing FRESH resume: resume.json

SECTIONS (8):

        employment:     4
         education:     2
           service:     1
            skills:     3
           writing:     0
            social:     2
         interests:     0
         languages:     0

COVERAGE (100.0%):

        Total Days:  3904
          Employed:  3904
              Gaps:     0  []
          Overlaps:     2  [1919, 304]

KEYWORDS (13):

            HTML 5:     1 mentions
               CSS:     1 mentions
        Javascript:     2 mentions
              LAMP:     1 mentions
             XAMPP:     1 mentions
              REST:     2 mentions
               PHP:     1 mentions
              AJAX:     1 mentions
             MySQL:     1 mentions
   SQL Server 2008:     1 mentions
           Node.js:     1 mentions
            jQuery:     1 mentions
         Bootstrap:     1 mentions
             TOTAL:    15 mentions
dave@Dave-MacBookAir:~/Downloads$ 

@hacksalot
Copy link
Owner

Thanks @kneeki. If you install latest (1.5.1) and pass in the -d or --debug option when you run hackmyresume build you should get a stack trace which may help track this down.

@umpirsky
Copy link

umpirsky commented Jan 8, 2016

Tested with 1.5.1:

$ node_modules/.bin/hackmyresume BUILD resume.json TO resume.pdf -d

*** HackMyResume v1.5.1 ***
Reading resume: resume.json
Applying MODERN theme (5 formats)
Generating PDF  resume: resume.pdf
ERROR: Cannot read property 'stack' of undefined
TypeError: Cannot read property 'stack' of undefined
    at Class.module.exports.TemplateGenerator.extend.onBeforeSave (resume/node_modules/hackmyresume/src/generators/html-pdf-cli-generator.js:51:84)
    at resume/node_modules/hackmyresume/src/generators/template-generator.js:156:32
    at Array.forEach (native)
    at Class.module.exports.BaseGenerator.extend.generate (resume/node_modules/hackmyresume/src/generators/template-generator.js:144:21)
    at single (resume/node_modules/hackmyresume/src/verbs/build.js:193:32)
    at resume/node_modules/hackmyresume/src/verbs/build.js:85:17
    at Array.forEach (native)
    at build (resume/node_modules/hackmyresume/src/verbs/build.js:84:13)
    at Command.execVerb (resume/node_modules/hackmyresume/src/index.js:177:28)
    at Command.<anonymous> (resume/node_modules/hackmyresume/src/index.js:110:16)
The MODERN theme says: "To get colored skill 
progress bars, make sure your resume includes a `level` 
element for each skill!"

@hacksalot
Copy link
Owner

Okay and one last question. Can you successfully run wkhtmltopdf from a regular system prompt? Eg,

wkhtmltopdf input.html output.pdf

If it's not installed and path-accessible, or if wkhtmltopdf is itself returning an error, HMR will error out.

@DaveTacker
Copy link
Author

Yep, no problems.

dave@Dave-MacBookAir:~/Downloads$ wkhtmltopdf resume.html topdf.pdf
Loading page (1/2)
Printing pages (2/2)                                               
Done                                                           
dave@Dave-MacBookAir:~/Downloads$ 

@hacksalot
Copy link
Owner

There was actually a glitch in that stack trace (now resolved in 1.5.2). If you can post the trace one more time w/ latest version we should be able to resolve this. Thanks!

@DaveTacker
Copy link
Author

It doesn't look like the -d flag performed the trace.

dave@Dave-MacBookAir:~/Downloads$ hackmyresume build resume.json to resume.pdf -d

*** HackMyResume v1.5.2 ***
Reading resume: resume.json
Applying MODERN theme (5 formats)
Generating PDF  resume: resume.pdf
ERROR: [object Object]
The MODERN theme says: "To get colored skill 
progress bars, make sure your resume includes a `level` 
element for each skill!"
dave@Dave-MacBookAir:~/Downloads$ 

@hacksalot
Copy link
Owner

Thanks for the feedback @kneeki @umpirsky. There are a few corner cases in the code where an error can occur but have no stack trace associated with it, so this helps somewhat to narrow it down. If you'd be willing to send me ([email protected]) or post here an anonymized version of the resume (.json) that is yielding this error, we'll roll out a hotfix today.

@codekirei
Copy link

Hmm, I'm getting the [object Object] error as well when attempting to create a PDF with Phantom.js, even with a clean new resume and the default theme.

OS: Arch Linux x86_64
Node: 5.4.0
NPM: 3.5.3

> hackmyresume new test.json

*** HackMyResume v1.5.2 ***
Creating new FRESH resume: test.json
> hackmyresume analyze test.json 

*** HackMyResume v1.5.2 ***
Reading resume: test.json
Analyzing FRESH resume: test.json

SECTIONS (14):

            social:     1
        employment:     2
          projects:     1
         education:     1
           service:     2
            skills:     2
           samples:     1
           writing:     1
           reading:     3
       recognition:     2
        references:     2
      testimonials:     1
         languages:     2
         interests:     2

COVERAGE (100.0%):

        Total Days:  2383
          Employed:  2383
              Gaps:     0  []
          Overlaps:     0  []

KEYWORDS (10):

              LAMP:     1 mentions
        JavaScript:     1 mentions
            HTML 5:     1 mentions
        Angular.js:     1 mentions
            jQuery:     1 mentions
              Sass:     1 mentions
              LESS:     1 mentions
      Tokagure Ryu:     1 mentions
          Shuriken:     1 mentions
             Yogen:     1 mentions
             TOTAL:    10 mentions
> which phantomjs
/home/codekirei/code/node/npm/bin/phantomjs
> hackmyresume build test.json to out/resume.pdf --pdf phantomjs

*** HackMyResume v1.5.2 ***
Reading resume: test.json
Applying MODERN theme (5 formats)
Generating PDF  resume (with phantomjs): out/resume.pdf
ERROR: [object Object]
The MODERN theme says: "To get colored skill 
progress bars, make sure your resume includes a `level` 
element for each skill!"

The -d flag does not affect the output of build. build does still create out/modern-pdf.css.

LMK if any other logs would be helpful!

EDIT looks like these logs may not be helpful based on #97 (didn't look there before posting here) — I'll keep an eye out for 1.6 and try again when it drops!

@hacksalot hacksalot added the bug label Jan 11, 2016
@hacksalot hacksalot added this to the v1.6.0 milestone Jan 11, 2016
@hacksalot
Copy link
Owner

@codekirei Missed your comment -- thanks for the info! v1.6.0 will feature better logging (via -d) which should make it easier to trace down these errors. I believe the above issue is now fixed but will need to verify this post-release and likely patch in v1.6.1. Today or tomorrow.

@codekirei
Copy link

@hacksalot No worries! I'll for sure follow up when you release the next version to confirm the fix. Thanks for doing great work and making communication a priority!

@hacksalot
Copy link
Owner

Worth retrying in 1.7.0 even though we were never 100% able to reproduce this.

@codekirei
Copy link

Thanks for the update! analyze gives me an error now as well, and building a pdf with phantom still gives an error (but now there is a stack trace!). Apologies if I'm doing something clearly wrong on my end.

Here are the new logs:

versions

> hackmyresume -v

*** HackMyResume v1.7.0 ***
1.7.0

> phantomjs -v
1.9.8

new

> hackmyresume new test.json

*** HackMyResume v1.7.0 ***
Creating new FRESH resume: test.json

validate

> hackmyresume validate test.json 

*** HackMyResume v1.7.0 ***
Reading FRESH resume: test.json
Validating test.json against the fresh schema: VALID!

analyze

> hackmyresume analyze test.json -d

*** HackMyResume v1.7.0 ***
The -d or --debug switch was specified. DEBUG mode engaged.

  Platform:              linux
  Node.js:               v5.4.1
  HackMyResume:          v1.7.0
  FRESCA:                ~0.6.0

OPTIONS:

  debug                  true

Invoking ANALYZE command.
Reading FRESH resume: test.json
Analyzing FRESH resume: test.json
{ [Error: Cannot find module '../helpers/console-helpers'] code: 'MODULE_NOT_FOUND' }
Error: Cannot find module '../helpers/console-helpers'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Class.module.exports.Class.extend.do ({...}/npm/lib/node_modules/hackmyresume/src/cli/out.js:162:38)
    at EventEmitter.<anonymous> ({...}/npm/lib/node_modules/hackmyresume/src/cli/main.js:243:46)
    at emitOne (events.js:77:13)
    at EventEmitter.emit (events.js:169:7)
    at Class.module.exports.Class.extend.fire ({...}/npm/lib/node_modules/hackmyresume/node_modules/hackmycore/src/verbs/verb.js:53:20)
    at Class.module.exports.Class.extend.stat ({...}/npm/lib/node_modules/hackmyresume/node_modules/hackmycore/src/verbs/verb.js:79:12)

build .html

> hackmyresume build test.json to out/resume.html

*** HackMyResume v1.7.0 ***
Reading FRESH resume: test.json
Applying MODERN theme (8 formats)
Generating HTML resume: out/resume.html

build .pdf

> hackmyresume build test.json to out/resume.pdf -p phantom -d

*** HackMyResume v1.7.0 ***
The -d or --debug switch was specified. DEBUG mode engaged.

  Platform:              linux
  Node.js:               v5.4.1
  HackMyResume:          v1.7.0
  FRESCA:                ~0.6.0

OPTIONS:

  theme                  undefined
  prettify               true
  css                    undefined
  pdf                    phantom
  sort                   true
  tips                   undefined
  debug                  true

Invoking BUILD command.
Reading FRESH resume: test.json
Verifying MODERN theme.
Applying MODERN theme (8 formats)
Generating PDF  resume: out/resume.pdf (with phantom)
An error occurred during template invocation.
   Error: The partial section/info could not be found
Error: The partial section/info could not be found
    at Object.invokePartial ({...}/npm/lib/node_modules/hackmyresume/node_modules/handlebars/dist/cjs/handlebars/runtime.js:266:11)
    at Object.invokePartialWrapper [as invokePartial] ({...}/npm/lib/node_modules/hackmyresume/node_modules/handlebars/dist/cjs/handlebars/runtime.js:68:39)
    at Object.eval (eval at createFunctionContext ({...}/npm/lib/node_modules/hackmyresume/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:254:23), <anonymous>:18:28)
    at main ({...}/npm/lib/node_modules/hackmyresume/node_modules/handlebars/dist/cjs/handlebars/runtime.js:173:32)
    at ret ({...}/npm/lib/node_modules/hackmyresume/node_modules/handlebars/dist/cjs/handlebars/decorators/inline.js:16:19)
    at ret ({...}/npm/lib/node_modules/hackmyresume/node_modules/handlebars/dist/cjs/handlebars/runtime.js:176:12)
    at ret ({...}/npm/lib/node_modules/hackmyresume/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js:525:21)
    at Object.module.exports.generateSimple ({...}/npm/lib/node_modules/hackmyresume/node_modules/hackmycore/src/renderers/handlebars-generator.js:38:16)
    at Object.module.exports.generate ({...}/npm/lib/node_modules/hackmyresume/node_modules/hackmycore/src/renderers/handlebars-generator.js:76:19)
    at Class.module.exports.BaseGenerator.extend.single ({...}/npm/lib/node_modules/hackmyresume/node_modules/hackmycore/src/generators/template-generator.js:164:24)

@hacksalot
Copy link
Owner

Thanks-- the first issue (analyze) is now fixed. Working the second. Will update shortly.

@hacksalot
Copy link
Owner

As for the second issue with build, this is also now fixed. Pushing a fix shortly and some add'l tests.

As a sanity check, if you use .all as in hackmyresume build test.json to out/resume.all -p phantom -d does the generation succeed?

@codekirei
Copy link

.all works! I manually verified the output and everything appears to be correct. Awesome!

> hackmyresume build test.json to out/resume.all -p phantom -d

*** HackMyResume v1.7.0 ***
The -d or --debug switch was specified. DEBUG mode engaged.

  Platform:              linux
  Node.js:               v5.4.1
  HackMyResume:          v1.7.0
  FRESCA:                ~0.6.0

OPTIONS:

  theme                  undefined
  prettify               true
  css                    undefined
  pdf                    phantom
  sort                   true
  tips                   undefined
  debug                  true

Invoking BUILD command.
Reading FRESH resume: test.json
Verifying MODERN theme.
Applying MODERN theme (8 formats)
Generating TXT  resume: out/resume.txt
Generating MD   resume: out/resume.md
Generating DOC  resume: out/resume.doc
Generating HTML resume: out/resume.html
Generating PDF  resume: out/resume.pdf (with phantom)
Generating JSON resume: out/resume.json
Generating YML  resume: out/resume.yml
Generating PNG  resume: out/resume.png

@hacksalot
Copy link
Owner

Great, glad to hear it. 👍 We're polishing these resume formats again for 1.8.0 and later, feel free to log another issue for any visual glitches or typos, etc. The fix for the .pdf extension issue will actually be in tomorrow AM, not tonight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants