Skip to content

when using relative local theme path it raises "TypeError: Cannot read property 'join' of undefined" #493

@Ex-Ark

Description

@Ex-Ark

Env

node v14.15.4
resume-cli v3.0.4

Error

(node:11456) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'join' of undefined at _default (/usr/local/lib/node_modules/resume-cli/build/render-html.js:24:28)

Expected behaviour

Providing relative local theme path (i.e resume export --theme . resume export --theme ../json-resume-theme-kendall/ should not raise error from within resume-cli lib.

Full error stack

resume export --theme . --format html /tmp/out.html
(node:11456) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'join' of undefined
    at _default (/usr/local/lib/node_modules/resume-cli/build/render-html.js:24:28)
    at createHtml (/usr/local/lib/node_modules/resume-cli/build/export-resume.js:84:46)
    at module.exports (/usr/local/lib/node_modules/resume-cli/build/export-resume.js:36:5)
    at Command.<anonymous> (/usr/local/lib/node_modules/resume-cli/build/main.js:67:5)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Promise.all (index 0)
    at async /usr/local/lib/node_modules/resume-cli/build/main.js:79:3
(Use `node --trace-warnings ...` to show where the warning was created)
(node:11456) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:11456) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Hints

Due to recent changes (#469) when providing theme using . the path is not initialized inside render-html.js

see my comment on the changes directly

Temp fix

if you pass the theme without using relative path then it no longer crashes because path.join is not called on undefined object.

with absolute path instead :

resume export --theme /home/user/jsonresume-theme-kendall --format html
/tmp/out.html

Done! Find your new .html resume at:
 /tmp/out.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions