Importing a class in singleton does not work in CI

Godot Version




This is a reduced version of my setup:


class_name DebugTool
extends Node

static func print(x: Variant) -> void:
	if OS.is_debug_build():


This is loaded as singleton.

extends Node


# this get called on the server and clients
func _peer_connected(peer_id: int) -> void:
	DebugTool.print("Peer connected with id: " + str(peer_id))

This works fine on my desktop.
However, if I build my project on CI I get this error:

SCRIPT ERROR: Parse Error: Identifier "DebugTool" not declared in the current scope.
          at: GDScript::reload (res://global/

Is there something wrong with my script?
Is this a bug?
If this is a bug, has it been reported?

Is the singleton stuff called by the _ready() function? That could be a potential culprit.

I am not sure, what you mean.
The /global/ has a _ready-function.
Here is how it looks like:

func _ready() -> void:

I reduced everything to a minimal project:

Here is an example output of the ci pipeline:

If you comment out this line (or skip all the 5 lines in the _ready() function), does the error message disappear?

It does not help, but I think I could reduce the problem more and I think it is a bug.
I will create a bugreport and link it here.

The problem is that the file .godot/global_script_class_cache.cfg not generated at first and that is somehow a problem.

There is already an issue open:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.