godotengine / godotengine/godot

Could not preload resource file / cyclic dependency ?

Open
#98,518 1 comment 0 reactions 0 assignees View on GitHub
bug topic:core topic:gdscript
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

Reproductile in: 4.3 stable / 4.4 dev

### System information

Godot v4.4.dev1 - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 6GB (NVIDIA; 32.0.15.6109) - AMD Ryzen 7 2700X Eight-Core Processor (16 Threads)

### Issue description

Some files that I preload and that worked until now decided to stop working (the links are still valid).

This is not the first time that this happens to me on this project, I use a lot of custom resources and adding a single line can sometimes cause this, I've managed to get around the problem so far, but it happened to me again, and I don't know which line caused it.

I have the impression that it is the fact of referencing a class in a cyclical way but I'm not sure and part of the problem is that it's very difficult to know which line causes this (and I get no information about the source of the problem other than the inability to preload files of a certain class)

I think that I can use load instead of preload in most cases, which should solve the problem, but it's a bit annoying to use an approach that works for days and then after a while decides to stop working without warning.

### Steps to reproduce

I'm not sure if this is exactly the problem I have in my project, because the error is not identical but in the minimum project I manage to have the panel that indicates that there is a cyclic reference when I try to assign a resource exported via the inspector.

When I try to preload this same resource I get an error that indicates that the type of the resource is "Resource" (while it is of type ResourceJob) so I think the error message is incorrect and should be the same as the one indicated in the inspector.

### Minimal reproduction project (MRP)

[BugResourcePreload.zip](https://github.com/user-attachments/files/17520664/BugResourcePreload.zip)

I manage to recreate problems by creating custom resource cyclic dependencies, but not exactly the one I get in my project.
In my project I just get the error: Parser Error: Could not preload resource file", I can share it privately if it can help to solve the problem.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.