Skip to content

Creating new Scene or Prefab file in a TypeScript project results in an error #81

@scottwestover

Description

@scottwestover

Version

  • Phaser Editor Version: 4.11.2
  • Operating System: macOS Sequoia 15.3
  • Web Browser and version: Chrome 134.0.6998.166

Description

In a TypeScript project, if you create a brand new Scene or Prefab file, and then open the related .ts file, there is an uncaught error being reported in the developer console. This error results in the Intellisense not working properly in these files.

Example of intellisense error in the .ts files when opened in the Editor:

Image Image

Example of the error shown in the developer console when these files are opened:

Image Image

If you reload the Editor, and try to re-open these files, there error goes away and the intellisense issue no longer occurs.

Steps to reproduce:

  1. create a new Phaser Editor project and use the Vite TypeScript project template as a base
  2. install the project dependencies when prompted
  3. after project is created and loaded, create a new Phaser.Scene file and attempt to open the related .ts file
  4. you should see the intellisense error and error in the developer console
  5. create a new Prefab file and attempt to open the related .ts file, and you should see the same error

Possible solution

For a workaround, you can do View -> Reload, or View -> Force Reload to reload the editor (or use the shortcut), and when you open the .ts files, the issue does not occur.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions