Skip to content

Misleading error when Autoloads appear in the wrong order (Native class "" not found.) #83230

Closed
@sorlok

Description

@sorlok

Godot version

v4.2.dev6.official [57a6813]

System information

Windows 10 - 64 bit - Forward+

Issue description

If you have two AutoLoad scripts (A and B), and B references A, then B must appear after A in the "Autoloads" list. When this is not the case, the editor will give the following cryptic "Error", in the "Debugger" panel:

    Native class "" not found

I think it would be better to say something like:
"Class B references class A, but B appears before A in the Autoloads list"

Note that this is some kind of parsing error that occurs at runtime --even though the error appears, it is still possible for B to use A while the game is running. (Or maybe putting B before A is not actually even an error, and I've been doing too much C++ programming?) Regardless, the error message is very misleading.

Steps to reproduce

  1. Open the sample project
  2. Run "Main.tscn"; close it once the window opens
  3. Look in "Debugger -> Errors" on the lower panel. You will see: "Native class "" not found"
  4. Press "Clear" to clear all errors.
  5. Now, go to "Project -> Project Settings", and in "Autoload", drag "GameData" so that it is after "MasterNode".
  6. Re-run "Main.tscn"; close it once the window opens.
  7. Look in "Debugger -> Errors" on the lower panel. You will see no errors.

Note that "GameData" references "MasterNode", so it should appear after that in the Autoload list.

Minimal reproduction project

AutoloadIssueTestCase.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions