Skip to content

Cannot read property 'emit' of undefined #5675

Closed

Description

@monteiz

Version

  • Phaser Version: 3.53.1
  • Operating system:
  • Browser:

Description

Not a bug, but when I have an emitter that it emits but the particle texture has not been loaded, I get the following stacktrace:

Uncaught TypeError: Cannot read property 'emit' of undefined
    at Label.removeFromDisplayList (phaser.min.js:1)
    at Label.destroy (phaser.min.js:1)
    at initialize.shutdown (phaser3.js:1)
    at initialize.l.emit (phaser3.js:1)
    at initialize.shutdown (phaser3.js:1)
    at initialize.stop (phaser3.js:1)
    at initialize.processQueue (phaser3.js:1)
    at initialize.update (phaser3.js:1)
    at initialize.step (phaser3.js:1)
    at initialize.step (phaser3.js:1)

That is, I do not have any information on which image is missing. The lack of this information makes it hard to fix the error.

It would be very useful to have the key of the missing image in the stacktrace.

Edit
Not sure it is a particles emitter. It may be an event dispatcher. The point is exactly that the lack of feedback makes it hard to debug.

Example Test Code

Additional Information

Activity

  1. samme commented on May 3, 2021

    @samme
    Contributor
  2. locked and limited conversation to collaborators on Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions