Godot singleton, made to class and then to singleton again, can't use it

Godot Version

4.3 beta 1


  • I had a singleton called Api
  • I made it into a class_name Api extends Node and remove the singleton
  • I decided to have it as a singleton anyway. Removed the class_name Api and returned the api.gd to the original state
  • I added it as a singleton again

Now, when I try to run the game, there is a parse error stating that

Parser Error: Cannot call non-static function "load_data()" on the class "res://scripts/singletons/api.gd" directly. Make an instance instead.

But, api.gd isn’t a class anymore.


# scripts/singletons/api.gd

extends Node
const HEADERS = ["Content-Type: application/json"]

rest of code...

I tried removing the project and cloning it from my Git repository again.

There seem to be something cached somewhere.

I removed this:

"base": &"Node2D",
"class": &"Api",
"icon": "",
"language": &"GDScript",
"path": "res://scripts/singletons/api.gd"

from .godot/global_script_class_cache.cfg