HTML5 error log from modules (SOLVED)

#1

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?

0 Likes

#2

Can you provide an example of this?

0 Likes

#3

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.

Minimal example:

(I wasn’t able to upload the file for some reason, so linking to Dropbox instead)

0 Likes

#4

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.

0 Likes

#5

Yeah. Prints and errors in .script files show in the debug log.

0 Likes

#6

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.

0 Likes

#7

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.

0 Likes

#8

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

1 Like

#9

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!

1 Like