You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Godot addon: Code parse error in project created in Godot 4.3 and upgraded to 4.8 #359
ERROR: res://addons/GDQuest_GDScript_formatter/plugin.gd:268 - Parse Error: Invalid argument for "set_setting_state()" function: argument 1 should be "Settings" but is "QuickSetupWindow.Settings"
The Error lives here:
func _update_quick_setup_settings_display() -> void:
for setting: QuickSetupWindow.Settings in [QuickSetupWindow.Settings.FORMAT_ON_SAVE, QuickSetupWindow.Settings.LINT_ON_SAVE]:
var state = get_editor_setting(_get_quick_setup_setting_name(setting))
quick_setup_window.set_setting_state(setting, state)
It's weird, on my end with 4.7.1 and 4.7.2, I get no errors. On this screenshot, you can see the code in question running in 4.8.dev6, and I tried also in 4.7.1 and 4.7.2.
I will remove the type hint anyway and hope that it addresses the thing for you. Could the issue be platform specific?
On your end, could you please try updating the function to use this code, save the file, then restart Godot? To verify that it does address the issue for you (as I cannot reproduce the error on my end):
You might need to disable the add on and re-enable it in the project settings to force this function to run again (I've also tested that in every version of Godot I have here).
Okay I checked on a fresh and empty project. No Problems there. Not on Windows not on Linux.
It seems my Project, which was created using 4.3 or 4.4 and just got updated all the time, or some other addon introduces the issue.
For your fix. When getting rid of the type and formatting code I get another error: Int could not be cast to object, which makes sense because set_setting_state() expects a Settings Object and not an Int, even though it would internally be an int, right?.
This Problem also only occurs in my old Project and not an new and empty project.
Seems I broke something on my end.
Thank you very much for taking the time to test and report your findings.
For you, as a workaround, I would recommend removing the code that loads and opens the quick setup window:
In plugin.gd, all the lines that reference the quick_setup_window variable or the QuickSetupWindowScene constant.
An easy way to do that would be to delete the editor folder in the add-on and then delete all the lines that raise errors in the plugin file as a result.
One thing I recommend checking in your project is if you happen to have any project settings in the project.godot file that look like they could affect this behavior. Either deprecated settings or I don't know, maybe special warnings treated as errors? Having created a project in an older version of Godot should not change how the GDScript parser and type resolution behave.
changed the title [-]Code parse error in project created in Godot 4.3 and upgraded to 4.8[/-][+]Godot addon: Code parse error in project created in Godot 4.3 and upgraded to 4.8[/+]on Sep 25, 2026
Activity
NathanLovato commentedon Sep 22, 2026
I'll test when I can but if it works in 4.7 and not in 4.8 this would perhaps be an issue in the development version.
DarthWeber19 commentedon Sep 22, 2026
Just checked with Godot 4.7.2
The Error comes up with 4.7.2 as well.
Addon was installed fresh.
DarthWeber19 commentedon Sep 22, 2026
AI tells me that there is a known parser limitation with enum type resolution across script boundaries in Godot 4.
I hope that helps
DarthWeber19 commentedon Sep 22, 2026
Checked older versions from the asset store.
0.23.0 has the same issue. (Godot 4.7.2 as well as 4.8.dev.6)
0.22.0 works fine.
NathanLovato commentedon Sep 22, 2026
Thank you very much for testing and reporting your findings!
NathanLovato commentedon Sep 23, 2026
It's weird, on my end with 4.7.1 and 4.7.2, I get no errors. On this screenshot, you can see the code in question running in 4.8.dev6, and I tried also in 4.7.1 and 4.7.2.
I will remove the type hint anyway and hope that it addresses the thing for you. Could the issue be platform specific?
NathanLovato commentedon Sep 23, 2026
On your end, could you please try updating the function to use this code, save the file, then restart Godot? To verify that it does address the issue for you (as I cannot reproduce the error on my end):
You might need to disable the add on and re-enable it in the project settings to force this function to run again (I've also tested that in every version of Godot I have here).
DarthWeber19 commentedon Sep 23, 2026
I will try and report back later today. I will check on my linux machine as well to check if it is a windows version issue.
DarthWeber19 commentedon Sep 23, 2026
Okay I checked on a fresh and empty project. No Problems there. Not on Windows not on Linux.
It seems my Project, which was created using 4.3 or 4.4 and just got updated all the time, or some other addon introduces the issue.
For your fix. When getting rid of the type and formatting code I get another error: Int could not be cast to object, which makes sense because set_setting_state() expects a Settings Object and not an Int, even though it would internally be an int, right?.
This Problem also only occurs in my old Project and not an new and empty project.
Seems I broke something on my end.
NathanLovato commentedon Sep 25, 2026
Thank you very much for taking the time to test and report your findings.
For you, as a workaround, I would recommend removing the code that loads and opens the quick setup window:
In plugin.gd, all the lines that reference the
quick_setup_windowvariable or theQuickSetupWindowSceneconstant.An easy way to do that would be to delete the editor folder in the add-on and then delete all the lines that raise errors in the plugin file as a result.
One thing I recommend checking in your project is if you happen to have any project settings in the project.godot file that look like they could affect this behavior. Either deprecated settings or I don't know, maybe special warnings treated as errors? Having created a project in an older version of Godot should not change how the GDScript parser and type resolution behave.
[-]Godot 4.8.dev6 Parse Error[/-][+]Code parse error in project created in Godot 4.3 and upgraded to 4.8[/+][-]Code parse error in project created in Godot 4.3 and upgraded to 4.8[/-][+]Godot addon: Code parse error in project created in Godot 4.3 and upgraded to 4.8[/+]DarthWeber19 commentedon Sep 25, 2026
I will do that. Thank you very much. Keep up the great work. 👍