godotengine / godotengine/godot

Godot reports "failed to load" on load the file, but the file loads correctly

Open
#106,960 5 comments 0 reactions 0 assignees View on GitHub
confirmed discussion topic:editor
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

v4.5.dev4.official [209a446e3]

### System information

w10 64

### Issue description

When Godot loads a project and one of the scripts contains a code error, it reports a load failure, even though the script itself is loaded correctly.
The error Godot shows is "failed to load script," which is supposed to be a file loading error, but it actually turns out to be a code error in the script.

This message from Godot mixes two separate issues: a code error and a file load error.
The message is unclear and causes confusion.

In my opinion, if it helps at all, this code error should not be reported as a "file load error." In fact, it shouldn’t even trigger a message like the one shown in the attached image during project loading. The project loading process should load the files and nothing more; it shouldn’t check for code errors.
It could show error messages related to file loading, for example with corrupted files, but it shouldn’t go beyond that.

![Image](https://github.com/user-attachments/assets/9d70b8be-cf4a-423f-bd46-331a5a7d5b43)

This is the script causing the message.

![Image](https://github.com/user-attachments/assets/e85bb9b8-ee7e-4de7-93bd-68257148aef9)

### Steps to reproduce

Load a project that has an issue in one of its scripts.

### Minimal reproduction project (MRP)

...

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.