Open ssangervasi opened 4 years ago
Thanks for reporting this! Thanks a lot for the very clear explanations and example file to reproduce the issue - this is appreciated :)
You're right that this is a bug. As you've seen a potential work around is to make an event that uses the extension - even if the event is never executed. Referencing any function of the extension will be enough to get the whole extension properly included.
I'll see if I can get this fixed!
Describe the bug
GDevelop does not always generate the corresponding JavaScript function for an extension function. If an an extension function
foo
is only referenced by another extension functionusesFoo
, then:usesFoo
appears fine. No error is reported while editing or during builduseFoo
raises an error when it attempts to accessfoo
. The events sheet has the name of a function it thinks should exist. In the example below,gdjs.evtsExt__FooExt__usesFoo.eventsList0x5b7538
callsgdjs.evtsExt__FooExt__foo.func
which does not exist.I've gone looking for the an issue matching this error, but as far as I can tell this hasn't been reported.
To Reproduce
Gist example: https://gist.github.com/ssangervasi/acddd389fb402af402a5f913a1e340b3
Steps to reproduce the behavior:
foo
/usesFoo
directly from the sheet.Error:
Other details
OS: Windows 10 GD version: 5.0.0-beta92 (latest)
I also tried reproducing in the browser version using Chrome, but I couldn't even get the basic extension functions to work. I'm not worried about that case, though.