Javascript Console Error

When trying to load a game on Facebook I keep getting “An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was: Uncaught TypeError: Cannot read property ‘length’ of null” What is going on - how do I fix this?

@Littleolady,
Thanks for reaching out! Usually this means that the length property [of something] is returning null and the rest of the content cannot be rendered with that given value. You often see this when loading games or other media content that require specific dimensions before they can display properly.

Can you try going to the fb game, opening your Shields panel in the address bar, and changing the Device recognition setting to Allow all device recognition? Allow the page to refresh and the game should load without issue :slight_smile:

Thank you - that worked perfectly!!

Mattches Browser Support
December 19

@Littleolady,
Thanks for reaching out! Usually this means that the length property [of something] is returning null and the rest of the content cannot be rendered with that given value. You often see this when loading games or other media content that require specific dimensions before they can display properly.

Can you try going to the fb game, opening your Shields panel in the address bar, and changing the Device recognition setting to Allow all device recognition? Allow the page to refresh and the game should load without issue :slight_smile:

1 Like