Closed Wend1go closed 6 years ago
Yes I get the error too. :) Thank you taking the time to report this problem. It is my understanding that the JS extension framework is still work in progress
It is my understanding that the JS extension framework is still work in progress
What is released should work, even if objects/events can't be declared in JS extensions. Let me check what can be wrong
Have you clicked on the arrow (next to [Object])? The error message should indicate what is wrong.
Open every error object until you get the final error message.
Also be sure to go to newIDE/app/public
, erase libGD.js
file, and then restart GDevelop (yarn start/npm start). Can maybe be related to an outdated libGD.js as extensions are loading properly for me.
The error message was: "Missing runExtensionSanityTests in the extension module exports."
My own test extension loaded successfully after I copied this line from Facebook to the end of my own JsExtension.js:
runExtensionSanityTests: function(extension) { return []; },
The Facebook extension already had it and Example extension is working now too. (even though I haven't changed anything in "Example".
Were the sanity tests in Example extension there right from the beginning? Looks I completely missed that part.
Were the sanity tests in Example extension there right from the beginning?
I've added this later, as it's quite easy to make mistakes when declaring extensions, so it can be handy to have a few tests written and running to ensure that things are working properly. :)
Is that working properly now/can we close the issue? Or is there something else?
For my part it can be closed. What about you @blurymind ?
@Wend1go @4ian thank you for getting this fixed. I can confirm that the example dummy js extension is now loading successfully!
This issue can be closed :) This is excellent!
@4ian on the dummy one I get a warning:
Object with type MyDummyExtension::DummyObject has no editor configuration registered. Please use registerEditorConfiguration to register your editor.
Does that mean that js extensions can be registered to use specific object editors?
This will help me with the Yarn extension :o
@blurymind Not yet, in fact the functions to declare object exist and work (as shown by the DummyObject of the example) but you cannot create an editor for your object... well you can by adding it directly to newIDE like the other objects. Ideally these editors would be provided by extensions, that's why I'm considering it's not finished. But objects can still be declared now if you want to.
(Closing the issue as the error have been solved, we can continue the discussion if needed)
@4ian thank you for clarifying =)
Describe the bug
The JavaScript extension example which is bundled with the newIDE raises an error when it gets included and isn't working. Also a very simple JavaScript test extension based on the working Facebook extension shows the same error.
To Reproduce
import-GDJS-Runtime.js
as described in README-extensions.md. (The files indeed get copied)Other details
@blurymind couldn't get to run any JavaScript extensions either.