Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phaser 3.50 and HEADLESS mode #5468

Closed
Grenagar opened this issue Dec 26, 2020 · 5 comments
Closed

Phaser 3.50 and HEADLESS mode #5468

Grenagar opened this issue Dec 26, 2020 · 5 comments

Comments

@Grenagar
Copy link

Version

Phaser Version: 3.50.0
Operating system: Windows
Typescript

Description

With version 3.50.0, when i try to use this.physics.add.image(x, y, 'player') in HEADLESS mode i got error:

Error: Uncaught [TypeError: Cannot read property 'pipelines' of null]
    at reportException (D:\GameProject\Java-RPG\node_modules\jsdom\lib\jsdom\living\helpers\runtime-script-errors.js:62:24)
    at Timeout.task [as _onTimeout] (D:\GameProject\Java-RPG\node_modules\jsdom\lib\jsdom\browser\Window.js:404:9)
    at listOnTimeout (node:internal/timers:556:17)
    at processTimers (node:internal/timers:499:7) TypeError: Cannot read property 'pipelines' of null
    at ArcadeImage.initPipeline (file:///D:/GameProject/Java-RPG/dist/dev/authoritative-server/authoritativeServer.js:43536:34)
    at ArcadeImage.Image [as constructor] (file:///D:/GameProject/Java-RPG/dist/dev/authoritative-server/authoritativeServer.js:31473:14)
    at new ArcadeImage (file:///D:/GameProject/Java-RPG/dist/dev/authoritative-server/authoritativeServer.js:122025:15)
    at Factory.image (file:///D:/GameProject/Java-RPG/dist/dev/authoritative-server/authoritativeServer.js:121830:21)
    at new GameObject (file:///D:/GameProject/Java-RPG/dist/dev/authoritative-server/authoritativeServer.js:217573:43)
    at new Character (file:///D:/GameProject/Java-RPG/dist/dev/authoritative-server/authoritativeServer.js:217288:5)
    at new Mob (file:///D:/GameProject/Java-RPG/dist/dev/authoritative-server/authoritativeServer.js:217809:5)
    at file:///D:/GameProject/Java-RPG/dist/dev/authoritative-server/authoritativeServer.js:218525:31
    at Timeout.task [as _onTimeout] (D:\GameProject\Java-RPG\node_modules\jsdom\lib\jsdom\browser\Window.js:399:19)
    at listOnTimeout (node:internal/timers:556:17)

pipelines is property of renderer, may be HEADLESS renderer just dont work in 3.50? in 3.24 all works fine.

Example Test Code

const config = {
    type: HEADLESS,
    parent: 'phaser-example',
    width: 10000,
    height: 10000,
    physics: {
      default: 'arcade',
      arcade: {
        debug: false,
        gravity: { y: 0 }
      }
    },
    scene: MainScene,
    autoFocus: false
};
create() {
   this.physics.add.image(x, y, 'player')
};

Additional Information

@jnissenbaum18
Copy link

Running into the exact same error, I think you and I are following the same authoritative server guide. Of note was that tutorial was using version 3.15.1 for its authoritative server code.

@Grenagar
Copy link
Author

I worked all versions up to 3.24. So HEADLESS mode will not be working in 3.50 at all?

@photonstorm
Copy link
Collaborator

Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.

@jnissenbaum18
Copy link

@photonstorm,

Thank you!

@photonstorm
Copy link
Collaborator

This issue has been mentioned on Phaser. There might be relevant details there:

https://phaser.discourse.group/t/phaser-3-50-and-headless-mode/8461/3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants