rexrainbow / phaser3-rex-notes

Notes of phaser3 engine
MIT License
1.21k stars 260 forks source link

When using NPM package, rex UI plugin fails to load #268

Closed djdabs closed 2 years ago

djdabs commented 2 years ago

Setting up a scrollable panel. Was using rex UI plugin through NPM package, but its giving me an error pulling in plugin through game config.

Error: TypeError: Cannot read properties of undefined (reading 'game')

Plugin Setting:

import UIPlugin from 'phaser3-rex-plugins/templates/ui/ui-plugin.js';

{
        key: 'rexUI',
        plugin: UIPlugin,
        mapping: 'rexUI'
}

Versions:

"phaser3-rex-plugins": "^1.1.68",
"phaser": "^3.55.2",

Using the minified file in scene preload, everything works fine. Maybe NPM package needs an update?

rexrainbow commented 2 years ago

Please check that rexui is a scene plugin, not a global plugin.

djdabs commented 2 years ago

ah, yep that fixed it.. I was putting into globals.

Thank you for the quick reply Rex and for building these modules for us! 💯