Windows Export woes

Godot Version

4.2.2.stable

Question

I’m trying to export the game for Windows and I’m getting a panoply of errors when I run it from the *.console.exe.

I’ve been at it for the last hour and a half.

At this point all I can do it print the output on the console. From the messages I read in there, I suspect it has to do with the autoload files, but I’m not 100% sure and if it is the problem, how to fix it as it works fine in the editor.

HALP!

Godot Engine v4.2.2.stable.official.15073afe3 - https://godotengine.org
Vulkan API 1.3.277 - Forward+ - Using Vulkan Device #0: AMD - AMD Radeon RX 6800

SCRIPT ERROR: Parse Error: Preload file "res://scenes/ui/prompt.tscn" does not exist.
          at: GDScript::reload (res://scripts/Managers/DialogManager.gd:3)
SCRIPT ERROR: Parse Error: Cannot infer the type of "PromptScene" variable because the value doesn't have a set type.
          at: GDScript::reload (res://scripts/Managers/DialogManager.gd:3)
SCRIPT ERROR: Parse Error: Preload file "res://scenes/ui/weapon_noise.tscn" does not exist.
          at: GDScript::reload (res://scripts/Managers/DialogManager.gd:4)
SCRIPT ERROR: Parse Error: Cannot infer the type of "WeaponNoise" variable because the value doesn't have a set type.
          at: GDScript::reload (res://scripts/Managers/DialogManager.gd:4)
SCRIPT ERROR: Parse Error: Preload file "res://scenes/ui/temp_label.tscn" does not exist.
          at: GDScript::reload (res://scripts/Managers/DialogManager.gd:5)
SCRIPT ERROR: Parse Error: Cannot infer the type of "TempLabel" variable because the value doesn't have a set type.
          at: GDScript::reload (res://scripts/Managers/DialogManager.gd:5)
SCRIPT ERROR: Parse Error: Cannot infer the type of "wNoise" variable because the value doesn't have a set type.
          at: GDScript::reload (res://scripts/Managers/DialogManager.gd:59)
ERROR: Failed to load script "res://scripts/Managers/DialogManager.gd" with error "Parse error".
   at: load (modules/gdscript/gdscript.cpp:2726)
ERROR: Failed to instantiate an autoload, script 'res://scripts/Managers/DialogManager.gd' does not inherit from 'Node'.
   at: (main/main.cpp:3251)
SCRIPT ERROR: Parse Error: Preload file "res://scenes/room.tscn" does not exist.
          at: GDScript::reload (res://scripts/game.gd:59)
SCRIPT ERROR: Parse Error: Preload file "res://scenes/ui/prompt.tscn" does not exist.
          at: GDScript::reload (res://scripts/Managers/DialogManager.gd:3)
SCRIPT ERROR: Parse Error: Cannot infer the type of "PromptScene" variable because the value doesn't have a set type.
          at: GDScript::reload (res://scripts/Managers/DialogManager.gd:3)
SCRIPT ERROR: Parse Error: Preload file "res://scenes/ui/weapon_noise.tscn" does not exist.
          at: GDScript::reload (res://scripts/Managers/DialogManager.gd:4)
SCRIPT ERROR: Parse Error: Cannot infer the type of "WeaponNoise" variable because the value doesn't have a set type.
          at: GDScript::reload (res://scripts/Managers/DialogManager.gd:4)
SCRIPT ERROR: Parse Error: Preload file "res://scenes/ui/temp_label.tscn" does not exist.
          at: GDScript::reload (res://scripts/Managers/DialogManager.gd:5)
SCRIPT ERROR: Parse Error: Cannot infer the type of "TempLabel" variable because the value doesn't have a set type.
          at: GDScript::reload (res://scripts/Managers/DialogManager.gd:5)
SCRIPT ERROR: Parse Error: Cannot infer the type of "wNoise" variable because the value doesn't have a set type.
          at: GDScript::reload (res://scripts/Managers/DialogManager.gd:59)
SCRIPT ERROR: Parse Error: Preload file "res://scenes/equipment/player_equipment.tscn" does not exist.
          at: GDScript::reload (res://scripts/Sisters/player.gd:12)
SCRIPT ERROR: Compile Error:
          at: GDScript::reload (res://scripts/Managers/InputManager.gd:-1)
ERROR: Failed to load script "res://scripts/Managers/InputManager.gd" with error "Compilation failed".
   at: load (modules/gdscript/gdscript.cpp:2726)
SCRIPT ERROR: Parse Error: Preload file "res://scenes/ui/prompt.tscn" does not exist.
          at: GDScript::reload (res://Assets/Interaction/Interaction_Area/InteractionManager.gd:4)
SCRIPT ERROR: Parse Error: Cannot infer the type of "frame_prompt" variable because the value doesn't have a set type.
          at: GDScript::reload (res://Assets/Interaction/Interaction_Area/InteractionManager.gd:4)
ERROR: Failed to load script "res://Assets/Interaction/Interaction_Area/InteractionManager.gd" with error "Parse error".
   at: load (modules/gdscript/gdscript.cpp:2726)
ERROR: Failed to instantiate an autoload, script 'res://Assets/Interaction/Interaction_Area/InteractionManager.gd' does.
   at: (main/main.cpp:3251)
SCRIPT ERROR: Parse Error: Preload file "res://scenes/room.tscn" does not exist.
          at: GDScript::reload (res://scripts/game.gd:59)
SCRIPT ERROR: Compile Error:
          at: GDScript::reload (res://Assets/Interaction/Room_Area/RoomManager.gd:-1)
ERROR: Failed to load script "res://Assets/Interaction/Room_Area/RoomManager.gd" with error "Compilation failed".
   at: load (modules/gdscript/gdscript.cpp:2726)
SCRIPT ERROR: Parse Error: Preload file "res://scenes/ui/prompt.tscn" does not exist.
          at: GDScript::reload (res://scripts/Managers/DialogManager.gd:3)
SCRIPT ERROR: Parse Error: Cannot infer the type of "PromptScene" variable because the value doesn't have a set type.
          at: GDScript::reload (res://scripts/Managers/DialogManager.gd:3)
SCRIPT ERROR: Parse Error: Preload file "res://scenes/ui/weapon_noise.tscn" does not exist.
          at: GDScript::reload (res://scripts/Managers/DialogManager.gd:4)
SCRIPT ERROR: Parse Error: Cannot infer the type of "WeaponNoise" variable because the value doesn't have a set type.
          at: GDScript::reload (res://scripts/Managers/DialogManager.gd:4)
SCRIPT ERROR: Parse Error: Preload file "res://scenes/ui/temp_label.tscn" does not exist.
          at: GDScript::reload (res://scripts/Managers/DialogManager.gd:5)
SCRIPT ERROR: Parse Error: Cannot infer the type of "TempLabel" variable because the value doesn't have a set type.
          at: GDScript::reload (res://scripts/Managers/DialogManager.gd:5)
SCRIPT ERROR: Parse Error: Cannot infer the type of "wNoise" variable because the value doesn't have a set type.
          at: GDScript::reload (res://scripts/Managers/DialogManager.gd:59)
SCRIPT ERROR: Parse Error: Preload file "res://scenes/room.tscn" does not exist.
          at: GDScript::reload (res://scripts/game.gd:59)
SCRIPT ERROR: Compile Error:
          at: GDScript::reload (res://scripts/Gui/title_menu.gd:-1)
ERROR: Failed to load script "res://scripts/Gui/title_menu.gd" with error "Compilation failed".
   at: load (modules/gdscript/gdscript.cpp:2726)

EDIT: Removed unnecessary lines, because of high level of clutter.

Based on the errors it looks like you had a preload() on scripts/Managers/DialogManager.gd trying to load res://scenes/ui/prompt.tscn

Is this path correct? Maybe you moved your files around and forgot to update the string references there?

Using preload is actually very dangerous, and can crash in unexpected ways if you don’t take care of what preloads what (cyclic references)

You can change the preload for load to avoid all those problems , the downsize is that you don’t get the performance benefit of loading things in memory beforehand.

The next error about ‘cannot infer type’ might depend on what your code does, but if it is just gdscript parser being strange, you can just set the type statically like var scene : ClassType = whatever.
Or it might be a consequence of the first error. Fixing that will probably fix these errors too.


tl;dr:

  • Check the preload path files are correct.
  • Try to replace all preloads with loads to check if that solves the problem

If it does, then you probably have a cyclic reference on your preloads somewhere.

  • Try using static typing for those ‘infer’ type errors in case the parser is being weird.

There also used to be a bug where .tres and .tscn files where being renamed to .remap on export but the ‘should’ have been fixed for a while now.

Alright. Well…

I found the problem and it was indeed the preload path. And the thing is, I posted a thread about an issue I got when renaming directories as it crashed the editor.

What I’m guessing happened is that the renaming didn’t happen when it crashed (it did work for some paths, but not all of them, for some reason).

The game works, but now I have leaks when I exit the game… But that’s for another thread.

Thanks.

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