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.Physics.Arcade.Events is not exported #4481

Closed
danielalves opened this issue Apr 19, 2019 · 1 comment
Closed

Phaser.Physics.Arcade.Events is not exported #4481

danielalves opened this issue Apr 19, 2019 · 1 comment

Comments

@danielalves
Copy link

Version

  • Phaser Version: 3.16.2
  • Operating system: macOS High Sierra
  • Browser: All

Description

Arcade Physics events constants are not being exported in Arcade Physics index file, although they're declared as being visible in the typescript types definition file.

Example Test Code

This code will compile:

import * as Phaser from 'phaser';

// ...

gameObject.on(Phaser.Physics.Arcade.Events.COLLIDE, () => {
  console.log('Collided!');
});

But will throw a runtime error like this one:

TypeError: phaser__WEBPACK_IMPORTED_MODULE_0__.Physics.Arcade.Events is undefined

Additional Information

This problem is quite easy to fix. We just need to add the following property to the Arcade variable in the Arcade Physics index file:

Events: require('./events'),
@danielalves danielalves changed the title Phaser.Physics.Arcade.Events.COLLIDE is not exported Phaser.Physics.Arcade.Events is not exported Apr 19, 2019
@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.

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

No branches or pull requests

2 participants