saadq / resumake.io

đź“ť A website for automatically generating elegant LaTeX resumes.
https://resumake.io
MIT License
3.31k stars 446 forks source link

Error when importing json resume v1.0.0 #55

Open mqzry opened 6 years ago

mqzry commented 6 years ago

After importing my json resume (v1.0.0), going to 'Skills' gives me consistently the following error:

TypeError: Cannot read property 'map' of undefined at i (Skill.js:48) at beginWork (react-dom.production.min.js:132) at o (react-dom.production.min.js:161) at a (react-dom.production.min.js:161) at u (react-dom.production.min.js:162) at O (react-dom.production.min.js:169) at w (react-dom.production.min.js:168) at batchedUpdates (react-dom.production.min.js:171) at Z (react-dom.production.min.js:54) at Re (react-dom.production.min.js:71)

Minimal error json: { "skills": [ { "name": "Frontend Web Development", "level": "Master", "highlights": ["Javascript", "HTML5", "CSS", "SASS", "npm"] }, { "name": "Java Development", "level": "Master", "highlights": ["Java 8", "Maven", "Gradle", "Spring"] }, { "name": "Math", "level": "Master", "highlights": ["Algebra", "Topology", "Probability"] }, { "name": "Programming Languages", "level": "Master", "highlights": ["Java", "C#", "Python", "Javascript", "TypeScript", "Go", "Haskell", "Kotlin", "XSLT"] }, { "name": "Scripting", "level": "Advanced", "highlights": ["Python", "Bash"] }, { "name": "Database", "level": "Advanced", "highlights": ["CouchDB", "MongoDB", "MySQL", "SQL Server"] }, { "name": "Messaging", "level": "Intermediate", "highlights": ["RabbitMQ", "Kafka", "ActiveMQ"] }, { "name": "DevOps", "level": "Intermediate", "highlights": ["Docker", "Kubernetes", "Unix", "Microsoft Server"] } ], "projects": [ { "title": "Alien Invasion", "description": "2D platform game", "website": "https://rwols.itch.io/alieninvasiongame", "roles": ["Game developer", "level designer"], "highlights": ["Unity", "C#"] }] }

saadq commented 6 years ago

Thanks @mqzry, will look into this tommorrow!

Edit: I have some other things going on, so I may be a few days before I can get back to this.

anelook commented 6 years ago

Keywords are missing. Same error happens for projects. I suppose keywords should not be mandatory, right?

saadq commented 6 years ago

Very sorry that this dropped off my radar... I'm going to try to see what's up with this later today and get back to you guys.

saadq commented 6 years ago

@anelook Could you give me some example JSON to try out that causes an issue? I don't actually seem to be getting any problem using "Import JSON" with the JSON code mentioned in the first comment.

anelook commented 6 years ago

I used this json file - 1.json.zip After you upload the file, click on "Skills" or "Projects" to see the error. If you still can't see it, I'll make a short video :)

But I believe you can use any json file which lacks skill keywords. The issue is in Skill.js where we iterate through keywords (line 47) - at that moment keywords are undefined.

An easy primitive fix would be to set keywords to an empty array if no keywords are found (either in Skill.js itself or in the parent file). But I wonder if there is a more elegant solution.