4ian / GDevelop

🎮 Open-source, cross-platform 2D/3D/multiplayer game engine designed for everyone.
https://gdevelop.io
Other
11.62k stars 883 forks source link

Editor crash - BBText crash because of undefined style (reading 'fill') #6180

Open VanCastar opened 10 months ago

VanCastar commented 10 months ago

Describe what you were doing when the crash happened

I opened up The old and then working Miles Apart project. Then this happened when trying to start the main scene. Login etc worked fine but main menu scene was broken. Last time I ran it via editor was in Feb 2023 as a working project and nothing has changed after that but GDevelop version. I also tried to update all extensions but no change.

GDevelop version

5.3.186-0a6b0dc78508b65a61cf5bcad98827d8998a80e2

Platform info

System Version: 10.0.19045, Arch: x64, User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) GDevelop5/5.3.186 Chrome/100.0.4896.143 Electron/18.2.2 Safari/537.36, Platform: win32

Additional error context

uniqueErrorId: c9a8da99-e25b-4553-a094-5efae00e8fd9

TypeError: Cannot read properties of undefined (reading 'fill') at h.getFontString (C:\Users\Ramiel\AppData\Local\Programs\GDevelop\resources\GDJS\Runtime\Extensions\BBText\pixi-multistyle-text\dist\pixi-multistyle-text.umd.js:1:4971) at h.wordWrap (C:\Users\Ramiel\AppData\Local\Programs\GDevelop\resources\GDJS\Runtime\Extensions\BBText\pixi-multistyle-text\dist\pixi-multistyle-text.umd.js:1:11589) at h.updateText (C:\Users\Ramiel\AppData\Local\Programs\GDevelop\resources\GDJS\Runtime\Extensions\BBText\pixi-multistyle-text\dist\pixi-multistyle-text.umd.js:1:5629) at h.get (file...

Additional component context

in n
in t
in Unknown
in div
in div
in Unknown
in Measure
in mw
in Mw
in div
in div
in t
in div
in t
in n
in ForwardRef
in div
in l
in n
in n
in t
in Unknown
in QM
in div
in n
in oa
in div
in vO
in Unknown
in Qe
in f
in u
in v
in x
in j
in h
in h
in Z
in d
in Q
in n
in t
in xe
in n
in Ge
in tt
in t
in Unknown
in Unknown
in v
in ft
in t
in r
in n
in u
in l
in n
in Dr...
ClementPasteau commented 10 months ago

Thanks for reporting @VanCastar It looks like an issue coming from the BBText, using the pixi package "pixi-multistyle-text" (which is now archived unfortunately) Happens around this line https://github.com/tleunen/pixi-multistyle-text/blob/3a42873661533af916867f49917f47e764a26181/src/pixi-multistyle-text.ts#L395 though unsure which version we have in the project.

It could be because the upgrade of Pixi to 7 changed the interface of the TextStyle? Unsure. Would you be able to share your zipped project with us so we can take a look? Sharing it here or sending it via hello@gdevelop.io

VanCastar commented 10 months ago

Would you be able to share your zipped project with us so we can take a look? Sharing it here or sending it via hello@gdevelop.io

Unfortunately no, as I don’t have that particular project anymore..

ClementPasteau commented 1 month ago

Had a similar issue recently so posting on this one to track the analysis. Turns out we were wrongly doing a [color=255;255;255;] which cannot be parsed by the pixi-multistyle-text library. (it expects a #000000 color)

It is hard to prevent bad formatting directly in GDevelop, as the parsing of the text is done inside the library, so this error may happen again if the text used is not recognized by the library.

In conclusion, if someone has this problem again, check the text used for the BBText and ensure it matches the format suggested on the wiki page: https://wiki.gdevelop.io/gdevelop5/objects/bbtext/