When Phaser 4 was released, a change to the global import affected some project setups. If your project imports Phaser from NPM with import Phaser from 'phaser', that no longer works in Phaser 4. You need a wildcard import instead:
import * as Phaser from 'phaser';
However, if your project loads Phaser from the CDN as a global — which is how Scott's mini course project is set up — none of that applies. You just need to replace three files.
How to Update Phaser 4 in a CDN-Based Project
The update comes down to swapping out three files in your project:
First, grab the latest phaser.js from the Phaser CDN via the GitHub page, save it to your assets/javascript/ folder and replace the existing file. Then do the same for phaser.min.js for production. Finally, if you're using IntelliSense for type information, grab the updated phaser.d.ts from the Phaser GitHub repo under types/ and replace it in your src/types/ folder.
That's it. No code changes, no build tool configuration. Start the project and you'll see the updated Phaser version in the console banner.
Update Phaser Automatically with the Update Script
If you prefer the command line, the GitHub repo for Scott's mini course now includes an update script in the scripts folder. Run the shell script and specify the Phaser version you want, and it downloads and replaces the files automatically.
Both CDN URLs are in the video description, so you can grab them without pausing. The GitHub repo and update script are also linked there.
Watch the Tutorial
Scott Westover put together this quick tutorial for anyone following his Build Your First Game mini course who's been unsure about how to update Phaser safely. If you find his content useful, you can support him on Ko-fi.




