jsonresume / resume-cli

CLI tool to easily setup a new resume đź“‘
https://jsonresume.org
MIT License
4.54k stars 379 forks source link

Could not run the render function from local theme. #202

Open DaveTacker opened 8 years ago

DaveTacker commented 8 years ago

I'm running into an issue while developing a theme whereas I'm unable to utilize the resume serve command to quick 'n easy theme development. The only error I'm given is pretty ambiguous with neither Google nor the freenode channel being helpful. I have the same results if I utilize a theme from any repo (like Boilerplate) or if I specify my own resume.json. Running the command in a different directory (like ~/Downloads/) has the same result.

Running Ubuntu 15.10 on a MacBookAir.

Here's a copy/pasta of my terminal:

dave@Dave-MacBookAir:/var/www/html/jsonresume-theme-Kate$ resume serve

Preview: http://localhost:4000
Press ctrl-c to stop

Could not find: /var/www/html/jsonresume-theme-Kate/resume.json
Using example resume.json from resume-schema instead...
Could not run the render function from local theme.
{ basics: 
   { name: 'Richard Hendriks',
     label: 'Programmer',
     picture: '',
     email: 'richard.hendriks@mail.com',
     phone: '(912) 555-4321',
     website: 'http://richardhendricks.com',
     summary: 'Richard hails from Tulsa. He has earned degrees from the University of Oklahoma and Stanford. (Go Sooners and Cardinals!) Before starting Pied Piper, he worked for Hooli as a part time software developer. While his work focuses on applied information theory, mostly optimizing lossless compression schema of both the length-limited and adaptive variants, his non-work interests range widely, everything from quantum computing to chaos theory. He could tell you about it, but THAT would NOT be a “length-limited” conversation!',
     location: 
      { address: '2712 Broadway St',
        postalCode: 'CA 94115',
        city: 'San Francisco',
        countryCode: 'US',
        region: 'California' },
     profiles: [ [Object], [Object] ] },
  work: 
   [ { company: 'Pied Piper',
       position: 'CEO/President',
       website: 'http://piedpiper.com',
       startDate: '2013-12-01',
       endDate: '2014-12-01',
       summary: 'Pied Piper is a multi-platform technology based on a proprietary universal compression algorithm that has consistently fielded high Weisman Scores™ that are not merely competitive, but approach the theoretical limit of lossless compression.',
       highlights: [Object] } ],
  volunteer: 
   [ { organization: 'CoderDojo',
       position: 'Teacher',
       website: 'http://coderdojo.com/',
       startDate: '2012-01-01',
       endDate: '2013-01-01',
       summary: 'Global movement of free coding clubs for young people.',
       highlights: [Object] } ],
  education: 
   [ { institution: 'University of Oklahoma',
       area: 'Information Technology',
       studyType: 'Bachelor',
       startDate: '2011-06-01',
       endDate: '2014-01-01',
       gpa: '4.0',
       courses: [Object] } ],
  awards: 
   [ { title: 'Digital Compression Pioneer Award',
       date: '2014-11-01',
       awarder: 'Techcrunch',
       summary: 'There is no spoon.' } ],
  publications: 
   [ { name: 'Video compression for 3d media',
       publisher: 'Hooli',
       releaseDate: '2014-10-01',
       website: 'http://en.wikipedia.org/wiki/Silicon_Valley_(TV_series)',
       summary: 'Innovative middle-out compression algorithm that changes the way we store data.' } ],
  skills: 
   [ { name: 'Web Development', level: 'Master', keywords: [Object] },
     { name: 'Compression', level: 'Master', keywords: [Object] } ],
  languages: [ { language: 'English', fluency: 'Native speaker' } ],
  interests: [ { name: 'Wildlife', keywords: [Object] } ],
  references: 
   [ { name: 'Erlich Bachman',
       reference: 'It is my pleasure to recommend Richard, his performance working as a consultant for Main St. Company proved that he will be a valuable addition to any company.' } ] } 'flat'
Requesting theme from server...
mehtaphysical commented 8 years ago

did you npm install before running resume serve?

DaveTacker commented 8 years ago

Very sorry for the delay with this response. npm install did fix the problem. Thank you!

VaibhavP17 commented 5 years ago

Hi, Even after npm install, it doesnt seem to be working. It seems to be giving error for over a month or so. Please help me out.

aemonge commented 3 years ago

same here

javix64 commented 5 months ago

same here!

thomasdavis commented 5 months ago

@javix64 in the interim could you try https://github.com/rbardini/resumed

are you linking the theme locally with npm?

and/or how exactly are you attempting to develop a local theme?

are you in a theme directory cd jsonresume-theme-example

and then running resume serve ?

thomasdavis commented 5 months ago

@javix64 I've pushed up a new version should should fix your problem

try resume serve --theme . from within your local theme directory.

javix64 commented 5 months ago

Hey @thomasdavis, first of all: thank you for dedicate your time to this project <3

First of all, I am using Node v21 without no issues in the common theme stackoverflow, I can run without problems any script.

I was trying to modify the archived theme: jsonresume-stackoverflow-react from @levino that is a fork from jsonresume-stackoverflow.

When I use resume serve --theme . in the jsonresume-stackoverflow, is working without any problem.

But the problem is when I try to use the same script in the stackoverflow-react theme.

This is the output of my console:

[javi@x535 jsonresume-theme-stackoverflow-react]$ npm run dev

> jsonresume-theme-stackoverflow-react@2.1.0 dev
> resume serve --theme .

{
  theme: '.',
  dir: 'public',
  resumeFilename: 'resume.json',
  cb: [Function (anonymous)]
}

Preview: http://localhost:4000
Press ctrl-c to stop

Error: Theme . could not be resolved relative to /home/javi/developing/jsonresume-theme-stackoverflow-react
    at _default (/home/javi/developing/jsonresume-theme-stackoverflow-react/node_modules/resume-cli/build/render-html.js:25:13)
    at /home/javi/developing/jsonresume-theme-stackoverflow-react/node_modules/resume-cli/build/builder.js:42:26
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read/context:68:3)
Could not run the render function from local theme.
...
--- my resume goes here ---
...
Requesting theme from server...
/home/javi/developing/jsonresume-theme-stackoverflow-react/node_modules/resume-cli/build/builder.js:9
  return value.match(/jsonresume-theme-(.*)/)[1];
                                             ^

TypeError: Cannot read properties of null (reading '1')
    at denormalizeTheme (/home/javi/developing/jsonresume-theme-stackoverflow-react/node_modules/resume-cli/build/builder.js:9:46)
    at sendExportHTML (/home/javi/developing/jsonresume-theme-stackoverflow-react/node_modules/resume-cli/build/builder.js:14:30)
    at /home/javi/developing/jsonresume-theme-stackoverflow-react/node_modules/resume-cli/build/builder.js:50:7

Node.js v21.6.2
javix64 commented 5 months ago

Sorry Thomas. Something I did wrong. Now is running without any problem.

Thank you!

levino commented 5 months ago

Hey @javix64, very happy to hear that you like my project.

Just FYI: I moved the source from my repo to here. Also if you are changing the code because it lacks functionality that might be useful to others, let me know and I would happily review a PR.