inventures / hatchjs

Hatch.js - not officially supported
Other
72 stars 32 forks source link

Missing file - public/javascripts/i18n.js #3

Open ViktorNova opened 10 years ago

ViktorNova commented 10 years ago

New install - server crashes saying that public/javascripts/i18n.js does not exist

I got it running by copying the file from the old repo, but just letting ya know!

marcusgreenwood commented 10 years ago

This should be generated on startup. Make sure node has permissions to write to the public/js folder.

fantapop commented 10 years ago

The same thing happened for me. Permissions look fine. I'm still looking into why it may have happened.

fantapop commented 10 years ago

Okay the problem is in lib/api/i18n.js InternationalizationAPI.prototype.update.

This line: existingTranslations = fs.readFileSync((compound.parent ? compound.parent.root : compound.root) + '/public/javascripts/i18n.js'); throws an exception when the i18n.js file doesn't exist yet.

It's easily fixed by either catching the exception and using empty string for existingTranslations or by using fs.exists to make sure its there first. I could send a pull request if you want.

randunel commented 10 years ago

@fantapop a pr would be great!

protofALk commented 10 years ago

this happened to me too... can´t really seem to fix it - what needs to be in that file?

ivanbrykov commented 10 years ago

same thing for me. workaround: touch public/javascripts/i18n.js