rexrainbow / phaser3-rex-notes

Notes of phaser3 engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The plugins are not working in my lit/TS Project

itsmebasti opened this issue · comments

Hi there, first of all, thank you for your efforts and contribution!
I am trying to add your shaking plugin to my small project. I am running a node/lit app using Typescript.
When I try to add the plugin, the plugin does not have access to the Phaser dependencies.
I Get this error:

Uncaught ReferenceError: Phaser is not defined
    <anonymous> http://localhost:8081/node_modules/phaser3-rex-plugins/plugins/utils/system/IsSceneObject.js:1

Is there anything I need to add, to make it work (latest versions of everything eg. Phaser, and this plugin 3.80.1)

I could add import * as Phaser from "phaser"; to every single file of this dependency, but I wonder if there is anything I need do globally to make Phaser visible to the plugin.

assigning it to globalThis or window didn't help.

commented

I use import 'phaser' for ts environment.

This didn't work for me, I still get the same error. Is there any additional information I can provide?
I just added you to my private project (https://github.com/itsmebasti/tractor-legacy)
Feel free to run it using
yarn
yarn watch

npm should also work if prefered

commented

Sorry I don't want to dig into project, btw I am not familiar with typescript configuration neither.

Alright, I totally understand, I will try to create an animation for the shaking instead. When I stumble over your plugins again, which I probably will, I will investigate the problem a little more in detail :)

commented

Typescript configuration is complex, it includes tsconfig.json file, and the ts-plugin used in bundle tool, different bundle tool has their own ts-plugin. :(