howler.js icon indicating copy to clipboard operation
howler.js copied to clipboard

Android 4.4.4, Chrome 33.0.0, RangeError: Maximum call stack size exceeded

Open littlee opened this issue 5 years ago • 10 comments

my code:

const bgm = new Howl({
  src: require('./assets/gg.mp3'),
  loop: true
});

bgm.play();

the Readme said that it can be compatible with following browsers:

Browser Compatibility Tested in the following browsers/versions: Google Chrome 7.0+ Internet Explorer 9.0+ Firefox 4.0+ Safari 5.1.4+ Mobile Safari 6.0+ (after user input) Opera 12.0+ Microsoft Edge

But I receive this error on Android 4.4.4 device with Chrome 33.0.0

RangeError: Maximum call stack size exceeded
  at Object.a._loadQueue(/apg-great-china-four-h5/static/js/2.24fe0520.chunk.js)
  at _emit(../node_modules/howler/dist/howler.js:1867:1)
  at _ended(../node_modules/howler/dist/howler.js:1918:1)
  at play(../node_modules/howler/dist/howler.js:809:1)
  at _ended(../node_modules/howler/dist/howler.js:1922:1)
  at play(../node_modules/howler/dist/howler.js:809:1)
  at _ended(../node_modules/howler/dist/howler.js:1922:1)
  at play(../node_modules/howler/dist/howler.js:809:1)
  at _ended(../node_modules/howler/dist/howler.js:1922:1)
  at play(../node_modules/howler/dist/howler.js:809:1)
  at _ended(../node_modules/howler/dist/howler.js:1922:1)
  at play(../node_modules/howler/dist/howler.js:809:1)
  at _ended(../node_modules/howler/dist/howler.js:1922:1)
  at play(../node_modules/howler/dist/howler.js:809:1)
  at _ended(../node_modules/howler/dist/howler.js:1922:1)
  at play(../node_modules/howler/dist/howler.js:809:1)
  at _ended(../node_modules/howler/dist/howler.js:1922:1)
  at play(../node_modules/howler/dist/howler.js:809:1)
  at _ended(../node_modules/howler/dist/howler.js:1922:1)
  at play(../node_modules/howler/dist/howler.js:809:1)
  at _ended(../node_modules/howler/dist/howler.js:1922:1)
  at play(../node_modules/howler/dist/howler.js:809:1)
  at _ended(../node_modules/howler/dist/howler.js:1922:1)
  at play(../node_modules/howler/dist/howler.js:809:1)
  at _ended(../node_modules/howler/dist/howler.js:1922:1)
  at play(../node_modules/howler/dist/howler.js:809:1)
  at _ended(../node_modules/howler/dist/howler.js:1922:1)
  at play(../node_modules/howler/dist/howler.js:809:1)
  at _ended(../node_modules/howler/dist/howler.js:1922:1)
  at play(../node_modules/howler/dist/howler.js:809:1)
  at _ended(../node_modules/howler/dist/howler.js:1922:1)
  at play(../node_modules/howler/dist/howler.js:809:1)
  at _ended(../node_modules/howler/dist/howler.js:1922:1)
  at play(../node_modules/howler/dist/howler.js:809:1)
  at _ended(../node_modules/howler/dist/howler.js:1922:1)
  at play(../node_modules/howler/dist/howler.js:809:1)
  at _ended(../node_modules/howler/dist/howler.js:1922:1)
  at play(../node_modules/howler/dist/howler.js:809:1)
  at _ended(../node_modules/howler/dist/howler.js:1922:1)
  at play(../node_modules/howler/dist/howler.js:809:1)
  at _ended(../node_modules/howler/dist/howler.js:1922:1)
  at play(../node_modules/howler/dist/howler.js:809:1)
  at _ended(../node_modules/howler/dist/howler.js:1922:1)
  at play(../node_modules/howler/dist/howler.js:809:1)
  at _ended(../node_modules/howler/dist/howler.js:1922:1)
  at play(../node_modules/howler/dist/howler.js:809:1)
  at _ended(../node_modules/howler/dist/howler.js:1922:1)
  at play(../node_modules/howler/dist/howler.js:809:1)
  at _ended(../node_modules/howler/dist/howler.js:1922:1)
  at Object.a.play(../node_modules/howler/dist/howler.js:809:1)

sentry screenshot

WX20190724-114112@2x

littlee avatar Jul 24 '19 03:07 littlee

I also have this issue. To reproduce: try to play without first "unlocking" the browser, and then wait for a good bit of time, then click the browser to unlock it and begin playing.

It seems like the library is using some recursion thing to re-attempt playing to compensate for the unlock event which is overflowing.

kujukuju avatar Nov 28 '19 00:11 kujukuju

This seems pretty high priority. It reproduces on any devices I've found that uses chrome, iOS, android, windows, mac.

If you try to play a sound upon website load, and the user doesn't interact with your website for ~15 seconds, they're guaranteed to crash due to this bug.

kujukuju avatar Feb 17 '20 23:02 kujukuju

I've also seen this happen several times.

ErikSom avatar Feb 15 '21 11:02 ErikSom

currently, my workaround is to wait till user click on my game html-element

Beeblerox avatar Mar 09 '21 15:03 Beeblerox

Same here.

image

amlinux avatar Mar 26 '21 07:03 amlinux

This happens to our users on a daily basis. About 10 reports a day with various browsers including latest Chrome.

kahoot-karl avatar Feb 17 '22 11:02 kahoot-karl

is there any solution/ workaround for this issue? Or possibly what cause it?

Lumethys avatar Mar 14 '23 10:03 Lumethys