-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
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
Inconsistent base class detection #40584
Comments
I can consistently reproduce this by renaming the folder to anything else containing those scripts. Upon saving, After the folder renaming, when trying to modify the script to produce some parse error I get these errors popup everytime:
Notice different folder names. Likely different issue, but related to this one. |
Commit a97b843 is causing an inconsistent base class detection in my project again. Seems like I'll look into this again. |
@akien-mga yeah, it was better to revert those in the meantime. Thanks! I'm still not sure what is the root cause yet, but I'll keep digging. |
The root of the problem is Godot's cache. More specifically the file It's important to point out that Godot's caching mechanism is not working properly when opening projects with I'm not familiar with the relevant code that is causing this issue, and I will not be able to work on this anytime soon either. Clearing these caches works for me as a workaround in the meantime. |
Global script cache behavior has been improved in 4.0 so this is likely fixed, so downgrading the milestone to 3.x. |
NOTE:I am not sure if this is the right thread. Godot 4.1.1 stable, Ubuntu 22.04.02, Nvidia driver I am having a hell of a bad time with these errors: I have tried starting the project in these ways: I have many scripts that use class_name that are @tools. It's a kind of random roll as to which class_name it will complain about each time I want to run something. To "fix" it, I am forced to open each script and cut/past the class_name and then ctrl+s and after that I test by ctrl+clicking the class_name. If it shows a hand, it's kind-a-sort-a okay. I am quite stressed by this bug as I am also writing an addon and I can't imagine how to explain it to potential users who can't run the addon because they hit these errors. Quite aside from being able to just use Godot myself. HTH |
Adding some info: If you delete the entire .godot directory and start your project, it rebuilds everything and after that the classes are recognized again. A bit harsh, but hey.. |
I'm encountering the same issue with the ProtonScatter plugin. It only happen in my huge game project, and inconsistently : HungryProton/scatter#173 (comment) Deleting the .godot folder do solve the problem for a while, but it still comes back. Next time it happens I'll make a diff of the .godot to see what changes after deleting and regenerating it. |
Godot version:
3.2 branch commit 7b4b83e
OS/device including version:
Arch Linux
Issue description:
Attempting to add custom nodes using
class_name
andtool
has inconsistent behavior -- some scripts seem to extendReference
as the base class when this is not the case.Before following the steps to reproduce this issue, note that
grid_background/grid_background.gd
in the attached project extendsTextureRect
. Alsogrid_background/grid_texture.gd
extendsImageTexture
, but for some reason both are sometimes detected to extendReference
.Steps to reproduce:
project.godot
and check out the original_global_script_classes
:godot -e
, and when it finishes loading close it. There's a chanceGridBackground
andGridTexture
still extendReference
according toproject.godot
, but if you look at their script they do not. This is the case I'm referring to -- you have reproduced the issue.project.godot
do not showReference
as the base classes, try the following.grid_background
folder totest1
for example.project.godot
->GridTexture
andGridBackground
now "extend"Reference
at least according to that file.Minimal reproduction project:
InconsistentBaseClassDetection.zip
The text was updated successfully, but these errors were encountered: