Bug with custom build: Circular Dependency Causes Actor
to be undefined
in ParticleEmitter
#3055
Labels
bug
This issue describes undesirable, incorrect, or unexpected behavior
Description
I am using TypeScript source files directly from Excalibur.js instead of the bundle for several advantages:
This approach has been working well until a recent issue where
Actor
isundefined
when referenced in theParticleEmitter
class definition. This seems to be due to circular dependencies and import order issues, causingActor
to be undefined whenParticleEmitter
tries to extend it in my own bundled file.I understand if this is not recognised as a bug as this is a very specific problem, I am happy to fix it myself and hope it is accepted.
Steps to Reproduce
Build Excalibur with Vite or ESBuild with a small sample game, this needs configurations so that this also works with the imported
*.css
and.glsl
files because vite needs to import them using a?raw
prefix by default like this:I can create an working example using esbuild or vite if there is a need for it.
Expected Result
ParticleEmitter
should successfully extendActor
without encountering an undefined issue.Actual Result
The
Actor
class isundefined
whenParticleEmitter
attempts to extend it, due to circular dependencies and import order issues within the TypeScript source files.Environment
Current Workaround
Just use the official bundle instead of the sources directly as intended.
The text was updated successfully, but these errors were encountered: