-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
No longer working with Webpack? #499
Comments
Is this problem tied to typescript? I used https://github.com/phaserjs/template-webpack and added GridEngine (JS only) and I don't get that error message: https://silver-waddle-vr5vp6vg5jfx5r.github.dev/ This is the first time I am trying codespaces, so let me know if you can't access it. |
TypeScript should be fine, but I'll check the codespace example tomorrow just to be sure. |
Sorry for the delay. I can't see your example unfortunately. I'm using TypeScript version The JS version works fine for me (using template-webpack first, then applying the Basic Movement example from the docs on top of it). Ran a few more tests for the new project, downgrading to versions that the older functional project uses, weirdly enough I still can't get Grid Engine running (Typescript, Grid Engine, Phaser and Webpack were all downgraded). Will try again this weekend, keep you posted. |
Too bad with the codespace. I guess they are not easily sharable. Anyway, a minimum executable example that demonstrates the issue would be appreciated. |
I've created a repo for the issue: Codespaces apparently cannot be shared unless explicitly invited for collaboration to said repo, however you can create a codespace from the repository. This is effectively the same setup as in my OP message but with some changes to make it closer to existing setup of the latest project. Should work with either |
Not sure if I did anything wrong but I cloned your repo and then ran |
A final thing I'm testing (as a workaround) is to use UPDATE: using |
Update: After some testing with one of the older projects, the problem indeed seems to be TypeScript related, namely in how Using the latest of everything (webpack, phaser, GridEngine) with Comparison, in case you want to investigate further:
|
Thanks for figuring out a workaround. I can reproduce it, but I have no idea what is causing this yet. Let me know if the workaround stops working or if you found a solution. |
For a new dev project, we're using the lastest versions of Webpack (
5.91.0
) and Phaser (3.80.1
).I maintain a number of older projects, one of these uses Grid Engine (
2.34.0
) with an older version of Webpack (5.4.0
) but the latest version of Phaser (3.80.1
). I don't know what changed recently, but it seems that Grid Engine no longer properly works with the (newer) versions of Webpack.When I run the project, the following happens:
move
,moveTo
or another function, it throwsthis.gridEngine.moveTo is not a function
console.info(this.gridEngine)
), rather than providing information on the scene, whether it's headless, etcetera, it returns this:I'm not sure where to go from here. I've tried a number of things (see below); the only thing I'm still to try is to manually add it using
his.plugins.installScenePlugin
to bypass Webpack, but that's not the most ideal solution.How to reproduce
The easiest way to reproduce it is to use your example project (https://github.com/Annoraaq/grid-engine-ts-example) and then apply the Phaser webpack template on top of it (https://github.com/phaserjs/template-webpack). My project's setup is close to it and I've tested it with the example projects to find out when stuff actually stopped working, which was when Webpack was added.
I did notice is that Phaser console logs that
gridEngine
as a plugin is missing if imported as{ GridEngine }
. If that happens, the plugin is indeedundefined
andcreate()
fails as well.Importing as
GridEngine
instead of{ GridEngine }
resolves this but allows only(?)create()
to work.Extra information
esbuild
for this project, existing projects with Grid Engine unfortunately still require maintenance and rely on webpack for bundle splitting and pre-build texture modifications (tilemap extruding in this case).The text was updated successfully, but these errors were encountered: