user4173455
user4173455

Reputation: 89

Pixi.JS don't work on mobile devices couse AccessibilityManager throw error

When i click in chrome "toogle device toolbar" and browser go to mobile mode pixi.js won't working. On SAMSUNG A3 i have same problem too.

bundle.js:19086 Uncaught TypeError: Cannot read property 'appendChild' of null at AccessibilityManager.createTouchHook

Upvotes: 0

Views: 729

Answers (1)

user4173455
user4173455

Reputation: 89

I fixed it. My fault... I trying create PIXI.Application before document fully loaded. In desktop version its have no problem, but in mobile version its work incorrect, becouse using createTouchHook which try append child element to body of document.

Incorrect code:

let app = new PIXI.Application(config.screen.width, config.screen.height, { transparent: true });

 $(document).ready(function(){
     //some actions with pixi.js
 });

Correct code is:

$(document).ready(function() {
    let app = new PIXI.Application(config.screen.width, config.screen.height, { transparent: true });
});

Upvotes: 1

Related Questions