InvalidStateError IE11


I’m working on an HTML5 version of a game and I’m facing a problem on IE11.

When I move an item too fast (by click and drag), I got a :
SCRIPT5022: InvalidStateError
Stage.hx (1218,12)

I’m using a buch of libs such as Starling / Robotlegs and Ash.

My config:

  • lime 5.7.1
  • openfl 6.2.2
  • starling 1.8.11

I’ve tried to use an older version of starling, openfl and lime but I got the same error.
It’s probably due to my code but I don’t know really how to target where in my code the problem come from.

It works like a charm on FF & Chrome.

Can’t really post a link here because it’s kind of confidential at the moment, but I can send you link to the source and online demo by mail or mp.

Thanks a lot.

1 Like

I found a workaround,
it was a problem due to the way I play sound. I added a timer on IE to be sure that I have at least 500ms between two sonds played, it does the job.

That’s weird it’s only needed on IE, but I guess it’s because it a slow browser…



I wonder if this is the same issue?

I can’t say yes for sure, but in my case it defenitely has something to do with sound.
I had the same pb on two different projects/games, and for both of them I manage to fix it by adding a condition that makes sure 500ms seperate two play() call. (500 is arbitrary maybe 250 is enough though).

Maybe it has something to do with (lack of) Web Audio support:

We are using howler.js 2.0.4, but there are some changes/fixes in 2.0.5 that look like might help IE:

It may be worth trying a newer howler.js copy with your code, and seeing if it helps at all?

Pour info, j’ai le même problème. InvalidStateError.
Désactiver le son règle le problème.
Par contre la version 2.0.4 de howler.js ne règle pas le problème.

Je vais essayer de tracker les sons joué simultanément comme la suggéré alanlanglois

oops sorry, again in english

i had the same problem with invalidStateError,
i disabled the sound which solved the problem.

However, version 2.0.4 of howler.js doesn’t solve the problem,
i’ll track the simultanously played sound as suggested by alanlanglois

After the sound problem, something else came out (still in ie11)

-the responsible line is 1149, i still get InvalidStateError
it seems to happen during a mouse release (but not every, probably depends on how much i move during the mousedown period…)

It seems like “InvalidStateError” is related to audio, not mouse dragging. I could be wrong, though?