Skip to content

Missing import in Main.js (Vite) #11

@pixorama

Description

@pixorama

I created a project template using the command:

npm create @phaserjs/game@latest

When opening http://localhost:8080 in the browser, I get the error:

Uncaught ReferenceError: Phaser is not defined at main.js:18:15

Adding this line to Main.js solves the problem:

import * as Phaser from 'phaser';

I'm using create_game version 1.2.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions