Using HardonCollider crashes Facebook Instant, works locally (SOLVED)

I load an .svg file which is used for collision. This works locally, but not when exported to Facebook Instant. Is it possible to load .svg files on Facebook instant? I’ve tried to bundle the files, which didn’t work.

Edit: The svg thing might be a red herring, see below.

You file didn’t end up in the bundle?
Have you added the resource a bundled resource?:

So, the files do end up in the bundle, and maybe it isn’t the .svg files that are causing the issue. The screen turns black after loading, with these errors in the console:

Edit: I pulled an older version, without the XML parsing code I added for the SVG files, and now it runs. Will investigate and report back.

It’s something up with the HardonCollider library code. The offending line is this:

local HC = require 'hc.hardoncollider'

I’m using a modified version of this library.

Any idea how to troubleshoot this? The javascript console looks the same whether it works or not.

What is the actual filename? Can you double check the case and that it matches above? Also, check extension (.lua not .LUA).

Looked at the code and this will most definitely fail:

The require path is known. There is no need for that kind of magic. And Defold needs the paths to be explicit and static to include the files. There may be more require calls like the one above.

2 Likes

The path seems fine. And it would break locally if it wasn’t correct, right?

Really good call about the strange require’s in the lib. I’ve replaced these magic require’s with hard coded ones in my modified library.

EDIT: Now it works! Thanks @britzl!

3 Likes