Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

10 years ago by kbm

Hello everyone,

I have just spent an entire day trying to fix this on my own but I'm hopelessly stuck and need an answer to this very specific issue:

I exported my game from Construct 2 and it works flawlessly with Ejecta, except for one plugin which causes a black screen on startup and an error: the clay.io Plugin

Clay.io is a 3rd party service I use for leaderboards and unfortunately I can not really switch to something else because it's implemented quite deeply into my game.

I get the following error when building the app:

"TypeError: undefined is not an object (evaluating 'tag.parentNode') at Line 17462 in index.js"


This is the code in question:

( function() {
var clay = document.createElement( "script" );
clay.src = ( "https:" == document.location.protocol ? "https://" : "http://" ) + "clay.io/api/api.js";
var tag = document.getElementsByTagName( "script" )[0]; tag.parentNode.insertBefore( clay, tag );
} )();


The problem seems to be that the tag.parentNode line is undefined, which causes the error. Now when I delete the line in question everything works fine so this seems to be the only issue, but then - also - the entire Plugin stops working.

Can anyone help me out here? I am not a programmer and this is a bit beyond my scope of comprehension :(

10 years ago by Joncom

What do you mean when you say "building the app"?
Do you mean baking the app?

10 years ago by kbm

By building I mean exporting my game via Construct 2 (www.scirra.com), importing it into the "App" Folder of Ejecta and then running/building it with Xcode

10 years ago by stillen

I think the problem is there is no dom in ejecta, so there is no parent node to attach the script tag to. You will have to write a different way to import the script. Theres a few tutorials around here on how to do that for ejecta somewhere.
Page 1 of 1
« first « previous next › last »