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

[GDScript]: global_script_class_cache contains invalid entries and results in invalid parse errors #78642

Open
MikeSchulze opened this issue Jun 24, 2023 · 2 comments

Comments

@MikeSchulze
Copy link

MikeSchulze commented Jun 24, 2023

Godot version

v4.1.beta2.official [a2575cb]

System information

Windows10

Issue description

i do script generation on my plugin and it fails with an invalid error
user://tmp/example/example_tests.gd:2 - Parse Error: Class "TestPersonTest" hides a global script class.

The class do not exists in my project, but after generate/save and load this error pops up.

What i find out

There is still a invalid entry in the .godot/global_script_class_cache.cfg

"base": &"GdUnitTestSuite",
"class": &"TestPersonTest",
"icon": "",
"language": &"GDScript",
"path": "res://test/first-steps/test_person_test.gd"
}, {

This class existed for some manual testing, but has been deleted for some time.
A restart of the editor do not fix the .godot/global_script_class_cache.cfg

Steps to reproduce

Use the attached minimized project and run the scene.

Minimal reproduction project

gdUnit4.zip

@victorbstan
Copy link

is there a way to force update the global script cache file? I find that if I accidentally or on purpose copy a directory with classes and now there are duplicate class name definitions, this error happens (legitimate), but then delete one of the folders, the error persists until I manually change the class name, save the file, than change the class name back, for seemingly force Godot to realize there is no more conflict... this is tedious for a large project, and would be nice if Godot had a more active way of fixing itself, or for us to force an update to it's class names cache...

@jorgegayoso
Copy link

Same error here. Deleting or modifying .godot/global_script_class_cache.cfg doesn't seem to do anything since its repopulated with the same removed plugin. Any fix to this yet?

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

5 participants