Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
sorlok opened this issue Oct 13, 2023 · 2 comments

Comments

@sorlok
Copy link

sorlok commented Oct 13, 2023

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

@kleonc
Copy link
Member

kleonc commented Oct 13, 2023

Already fixed in v4.2.beta1.official [b137180], by #82784.

@kleonc kleonc closed this as completed Oct 13, 2023
@kleonc kleonc added this to the 4.2 milestone Oct 13, 2023
@sorlok
Copy link
Author

sorlok commented Oct 13, 2023

Confirmed fixed in v4.2.beta1.official. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants