Use wildcard import for top-level Phaser name#10
Merged
gammafp merged 2 commits intophaserjs:mainfrom Apr 21, 2026
Merged
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 53896b2. Configure here.
- Great catch by Cursor Bugbot regarding how this line should refer to Phaser's Math
Collaborator
|
Thank you @enderandpeter |
This was referenced Apr 21, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

These changes are meant to address #9. Although the original message in the issue says that the package.json should be updated for Phaser v4, that does not apply to this repo.
Instead, there was another issue that came up related to Phaser v4 regarding how it does not provide a global import. As a result, references to
Phaserthroughout the scaffolding templates will result in the error I reported in the issue. Also, I am very certain this Discord comment is referring to the same issue.The simplest way to resolve the
Uncaught ReferenceErroris for the template files to haveimport * as Phaser from 'phaser';so the original content can be retained.I only changed a file to refer to
Phaser.MathasPhaserMathwith an accompanying imported alias so thatMathwould still be available.Please review this very carefully. Let me know the best way to test the changes. I believe it's very possible to refer to my local project instead of the NPM project when using
npm createor something similar...Note
Medium Risk
Touches many starter templates and demo entrypoints; while changes are mostly import rewrites, incorrect module interop or tree-shaking differences could break generated projects across bundlers.
Overview
Switches scaffolding templates (Angular/React/Next/Remix/Solid/Vue) and multiple demo entrypoints to use a namespace import (
import * as Phaser from 'phaser') so existingPhaser.*references work with module-only Phaser builds.In
phasers-revenge, adjustsBulletto avoid shadowing the globalMathby aliasing the Phaser math import toPhaserMathand updating usages accordingly.Reviewed by Cursor Bugbot for commit 3e29cb6. Bugbot is set up for automated code reviews on this repo. Configure here.