NullEngine giving error, navigator not defined

Hi, I do get a following error with the latest Babylonjs 5.0 alpha 44 when I try to run NullEngine:

BJS - [23:16:58]: Babylon.js v5.0.0-alpha.44 - Null engine
Booting server...

file:///C:/projects/my-secret-game/node_modules/@babylonjs/core/Misc/tools.js:1073
        return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
                                                     ^

ReferenceError: navigator is not defined
    at Function.Tools.IsSafari (file:///C:/projects/my-secret-game/node_modules/@babylonjs/core/Misc/tools.js:1073:54)
    at ArcRotateCameraPointersInput.BaseCameraPointersInput (file:///C:/projects/my-secret-game/node_modules/@babylonjs/core/Cameras/Inputs/BaseCameraPointersInput.js:13:35)
    at new ArcRotateCameraPointersInput (file:///C:/projects/my-secret-game/node_modules/@babylonjs/core/Cameras/Inputs/arcRotateCameraPointersInput.js:12:47)
    at ArcRotateCameraInputsManager.addPointers (file:///C:/projects/my-secret-game/node_modules/@babylonjs/core/Cameras/arcRotateCameraInputsManager.js:33:18)
    at new ArcRotateCamera (file:///C:/projects/my-secret-game/node_modules/@babylonjs/core/Cameras/arcRotateCamera.js:199:52)
    at initEngine (file:///C:/projects/my-secret-game/packages/game/dist/engine/engine.js:22:20)  
    at bootServerGame (file:///C:/projects/my-secret-game/packages/game/dist/boot/index.js:7:11)  
    at file:///C:/projects/my-secret-game/packages/server/dist/index.js:8:1
    at ModuleJob.run (node:internal/modules/esm/module_job:175:25)
    at async Loader.import (node:internal/modules/esm/loader:178:24)

Is this related to this commit? Merge pull request #11005 from PolygonalSun/PolygonalSun/safari-context · BabylonJS/Babylon.js@3cc0378 · GitHub

1 Like

Thanks a lot for reporting it !!! I will fix it in the next nightly.

3 Likes

Thank you Seba! :slight_smile: Any estimate when will this be available through npm?

I ll try to make a new release tonight and if not, tomorrow :slight_smile:

1 Like

It works now :grin: Huge thanks for fixing it!

1 Like