I’ve noticed that when a Lua error happens within a module, that error is not printed to the console when bundled with HTML5. Is this expected? Is there a way to print the error?
Can you provide an example of this?
It seems to work when testing as HTML5 (Project > Build HTML5), but when bundled and uploaded to Facebook Instant, no error is printed to the log.
(I wasn’t able to upload the file for some reason, so linking to Dropbox instead)
Are you bundling a debug version? The release version will not log anything.
It could also be that app manifest is wrong and always gives you a release version of the engine.
Yeah. Prints and errors in .script files show in the debug log.
I assume this is related to: https://github.com/britzl/monarch/issues/56 ?
Monarch uses pcall() to protect against certain errors and it could be that the errors aren’t printed.
It might be related (it was the reason I wrote the post), but the example above doesn’t use Monarch. It prints stuff from the Facebook extension, but the module crash is silent.
Ah, yes, the fbinstant extension uses lua_pcall() when invoking the callback function which explains why the log is silent. The error is caught but silently ignored. I’ve created a ticket to keep track of this: https://github.com/defold/extension-fbinstant/issues/84
That’s interesting! I’m pretty sure I have seen the same behaviour outside fbinstant callbacks to, but I’ll have to test it.
Edit: That’s it! I tested it with the same project as above, but triggering the crash outside the fbinstant scope. Now the error shows. Thanks for adding it to the backlog!