# "Audio Cache entry missing: Sound"

**URL:** <https://phaser.discourse.group/t/audio-cache-entry-missing-sound/3632>\
**Category:** Phaser 3\
**Created:** [September 1, 2019, 4:55am UTC](https://phaser.discourse.group/t/audio-cache-entry-missing-sound/3632 "2019-09-01T04:55:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tuskat](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/tuskat/32/1950_2.png) [@Tuskat](https://phaser.discourse.group/u/Tuskat)\
**Post date:** [September 1, 2019, 4:55am UTC](https://phaser.discourse.group/t/audio-cache-entry-missing-sound/3632/1 "2019-09-01T04:55:47Z")

</div>

So I’m currently working on a project and opened it on Firefox (Ubuntu) and it’s completely broken. (the game has normally a small countdown then spawns enemies, but it’s just stuck and I can’t move)

my sound handling code look like this

```
import { GameScene } from "../scenes/gameScene";

// Usage :
// this.scene.gameEvent.emit(signalName, Object with {sound: signalSOund});
export class SoundEffects {
    private defaultUrl: string = '/src/games/cadre-de-guerre/assets/sounds/';
    private soundList = [
        'Alarm',
        // other sounds omitted for brevity
    ];
    private eventList = [
        'playerRespawned',
        // other events omitted for brevity
    ];
    private sounds = []
    scene: GameScene;

    constructor(params) {
      this.scene = params.scene;
    }

    preloadSound() {
      this.soundList.forEach(element => {
        this.scene.load.audio(element, this.defaultUrl + element + '.mp3', { instances: 1});
      });
    }
    initSound() {
        this.soundList.forEach(element => {
            this.sounds[element] = this.scene.sound.add(element.toString());
            this.sounds[element].volume = 0.3;
        });

        this.eventList.forEach(element => {
            this.scene.gameEvent.on(element, this.playSound, this);
        });
    }
    playSound(obj) {
        if (obj) {
            this.scene.sound.play(obj.sound);
        } else {
            console.log('no object sent');
        }
    }
  }

```

usage in the GameScene is like this :

```javascript
  constructor() {
    //...omitted code
    this.soundEffectsManager = new SoundEffects({ scene: this });
  }

  preload(): void {
    //...omitted code
    this.soundEffectsManager.preloadSound();
  }

  create(): void {
   // omitted code
    this.soundEffectsManager.initSound();
   // omitted code
  }

```

it works on Chrome but for some reason I can’t make it work on Firefox.  
The errors that I get on the console :

> Audio cache entry missing: Alarm phaser.js:76313:21
> 
> TypeError: this.currentConfig is undefined
> 
> Source map error: TypeError: sockjs.js.map is not a valid URL.  
> Resource URL: webpack:///./node\_modules/sockjs-client/dist/sockjs.js?  
> Source Map URL: sockjs.js.map

Maybe I’m missing something silly so…yeah 🤔  
pls help ༼ つ ◕\_◕ ༽つ

---

<div class="post-metadata">

**Author:** ![Tuskat](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/tuskat/32/1950_2.png) [@Tuskat](https://phaser.discourse.group/u/Tuskat)\
**Post date:** [September 15, 2019, 2:59am UTC](https://phaser.discourse.group/t/audio-cache-entry-missing-sound/3632/2 "2019-09-15T02:59:30Z")

</div>

_Update:_

`this.currentConfig` is in `Phaser.Sound.BaseSoundManager`  
I have no idea how to fix it as Phaser 3 sound seems to work fine on the website.

Maybe it’s a localhost/cors error, maybe it’s tied with the [boilerplate](https://github.com/digitsensitive/phaser3-typescript) I’m using that do not like this.currentConfig because of the typescript config…I have no idea.

Since preloadSound() doesn’t yell I’d assume this.scene.sound.add(sound) is the culprit.

I’ve temporaly disabled sound on linux firefox and it seems to do the trick.  
it’s less than ideal, but better than crashing the game altogether :

```javascript
    if (!this.isLinuxFirefox()) {
      this.soundEffectsManager.initSound();
    }

```

quick and dirty linux/firefox detect

```javascript
  isLinuxFirefox(): boolean {
    // because it crash in soundManager
    let is_linux = /Linux/.test(window.navigator.platform);
    let is_firefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
    return (is_firefox && is_linux);
  }

```
