Using custom data bindings crashes Crayta

Describe the bug:
I was using feature explained here:
Gameface: Data binding overview (coherent-labs.com)
and at some point game started to crash. I have created copy with that version and rolling back code in original version.

How do you cause this bug?

  • Run game Crayta
  • it would crash Crayta

Which platform: PC

Which input: Controller / keyboard + mouse

Your Crayta username: strowk

Game seen in (including “Hub” or “Editor for XYZ”): Editor or playing game “Radar Showcase crashing”

How regularly do you see this? (E.g. 2/3 times - please try 3 times if possible): 3 of 3

Time + date seen: 15.06.2022 20:25

Version number (found in Help tab in Settings): 0.f5.20.124108

Hey there @str ! :sun_with_face:

Thanks for sharing the point of reference! I have opened up a ticket and assigned it out so that we can further investigate what is causing this crash. We hope to have this fixed to you as soon as possible.

Hi,

I’m Chris from the Crayta dev team and I’ve been investigating this issue for you. I raised a ticket with Coherent and they got back to me this morning with some further information and a workaround you should be able to use to avoid the crash you’ve been seeing.

The crash is caused by some additional whitespace characters in the css for the linear-gradient you’ve added in the WhatMyAttributeHandler. I can see you’ve removed all the new-line characters, but it looks like you also need to remove tab characters as well, for example:

	    update(element, value) {
	    	console.log("chaging style")
	    	element.textContent  = "test2"
	    	element.style.color  = "red"
	    	element.style.background  = `linear-gradient(0deg, transparent 49%, #03b627 50%, transparent 51%), 
	    	linear-gradient(90deg, transparent 49%, #03b627 50%, transparent 51%)`.replaceAll("\n", "").replaceAll("\t", "");
	    /// This will be executed everytime that the model which the attribute is attached to is synchronized.
	    }

I’ve raised this issue with the Coherent Labs support team who will be working on making their code more robust to be able to handle the extra white-space in a future release.

Thanks,
-Chris

2 Likes

Oooh, very nice. Thanks, great detailed response!

So, no tabs in background field for now. Got it.