voidlabs / mosaico

Mosaico - Responsive Email Template Editor
https://mosaico.io
GNU General Public License v3.0
1.71k stars 504 forks source link

Is there a way to tell what went wrong? #355

Closed camertron closed 7 years ago

camertron commented 7 years ago

I'm trying to run Mosaico.init(...) in my app and it's returning false with no additional information. Is there a way to turn on logging or something so I can see what went wrong?

Hiswe commented 7 years ago

@camertron mosaico already logs everything by default

If you need more logs, you can easily put your own in the app.js#init and recompile mosaico

camertron commented 7 years ago

@Hiswe ok, that's good to know. I realized the problem was I didn't have a hash in the URL, and furthermore realized editor.html can't be opened on its own. I opened index.html and noticed that clicking on one of the templates appends a hash and redirects to the editor, which makes sense.

The error that gets printed to the console, i.e. "Missing initialization hash", was confusing to me because of how overloaded the word "hash" is in the programming world. Coming from Ruby, I think of a hash as a data structure of key/value pairs. So, long story short, Mosaico actually did tell me what was wrong, I just didn't understand :)

Thanks for your patience!