-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Autoload scripts compile error are not reported (except confusing "Script does not inherit from Node") #78230
Comments
On the current git tip you get on console:
LSP (vim, linux) reports the correct error here immediately after the code change as expected: |
Step 4 is resulting in an error for me from within Godot: I am getting the issue in Step 5 though: I'm not sure I understand what's wrong with 6 though. Valid code shouldn't result in a compile error! Autoloads do seem to be loaded through the |
The following error message appears on the first run and does not reappear after that:
This is a compile-time error message, if the script is cached, it won't be recompiled, so it won't reappear. It usually occurs when you modify and save the script. |
@anvilfolk There's still invalid code in the file, so I'd expect that modifying the file would recompile and re-emit the errors. |
FYI this issue affects any attached script, when using an external an editor, not just autoload. For example, if you attach a script with a mix of tabs/spaces, you'll get a meaningful error the first time you edit it:
But running the scene, you will only get the following runtime error which makes it difficult to figure out what went wrong
|
@OmarShehata can you check whether the issue in your last message is fixed in |
Currently, GDScripts who are only loaded through `ResourceLoader::load()`, like Autoloads, do not have a pathway to announce there is an error in their code. This contributes to significant confusion in error projects when autoloads are involved. At least partially closes godotengine#78230.
Currently, GDScripts who are only loaded through `ResourceLoader::load()`, like Autoloads, do not have a pathway to announce there is an error in their code. This contributes to significant confusion in error projects when autoloads are involved. At least partially closes godotengine#78230. (cherry picked from commit cca5717)
Currently, GDScripts who are only loaded through `ResourceLoader::load()`, like Autoloads, do not have a pathway to announce there is an error in their code. This contributes to significant confusion in error projects when autoloads are involved. At least partially closes godotengine#78230.
Godot version
v4.0.3.stable.official [5222a99]
System information
Win 10
Issue description
When Autoload scripts have compile errors, the error is not printed to Output. Instead, they fail when Running with an error completely unrelated to what's wrong:
There's no other information. I assume this message is because their failure to compile means they don't get associated as a Node child (related to #75388?)? But I don't understand why they don't have any errors reported. I think it only occurs if they were added to Autoload before they got compiled/used?
I am using an external editor (gvim) and godot's LSP support. That correctly shows the error, but only when I'm editing the broken file which makes it unclear what's wrong. (When I first encountered this problem, I looked at the files, saw they were extending Node2D and didn't understand the problem. It's possible the lsp was failing to show any errors, but it shows errors now.)
Steps to reproduce
seq
)seq
)Note: If you mix up steps 2 and 3, the issue will not occur.
Workaround: Edit Autoloads and disable and re-enable thetrouble's autoload state and error messages appear. New errors even appear after this point.
Minimal reproduction project
repro.zip
The text was updated successfully, but these errors were encountered: