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
I can't quite explain this one, but I happened to run into this when reporting #102551.
In short, there's something strange going on with GDScript when upgrading this particular MRP from 4.3 to 4.4, where you'll be met with parser errors after upgrading, that then manifest themselves at runtime as well.
It seems that it has something to do with the stuff that's cached in the .godot folder, as deleting it resolves the errors, regardless if you delete it before or after upgrading. As such, I've included a more comprehensive set of reproduction steps to create the project from scratch, as opposed to providing an MRP.
I tried reducing down the script to something even more minimal, but for whatever reason this particular script seems to force the problem.
Steps to reproduce
Create a new project using 4.3-stable
Add a 2D main scene, call it main.tscn
Add a new GDScript script through the FileSystem dock, call it my_resource.gd
Populate my_resource.gd with the following contents:
extendsResourceclass_nameMyResource
Attach a new script to the root of main.tscn, call it main.gd
ERROR: res://main.gd:3 - Parse Error: Could not find type "MyResource" in the current scope.
ERROR: res://main.gd:3 - Parse Error: Cannot use simple "@export" annotation because the type of the initialized value can't be inferred.
ERROR: res://main.gd:6 - Parse Error: Could not find type "MyResource" in the current scope.
ERROR: modules/gdscript/gdscript.cpp:3022 - Failed to load script "res://main.gd" with error "Parse error".
Reload the project
Note the lack of errors
Run the main scene
Note debugger break with error saying Parser Error: Could not find type "MyResource" in the current scope.
Close the project
Delete the .godot folder
Open the project again
Run the main scene
Note how it runs fine
Minimal reproduction project (MRP)
N/A
The text was updated successfully, but these errors were encountered:
Tested versions
System information
Godot v4.3.stable - Windows 10.0.26100 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4070 Laptop GPU (NVIDIA; 32.0.15.6636) - AMD Ryzen 9 7940HS w/ Radeon 780M Graphics (16 Threads)
Issue description
I can't quite explain this one, but I happened to run into this when reporting #102551.
In short, there's something strange going on with GDScript when upgrading this particular MRP from 4.3 to 4.4, where you'll be met with parser errors after upgrading, that then manifest themselves at runtime as well.
It seems that it has something to do with the stuff that's cached in the
.godot
folder, as deleting it resolves the errors, regardless if you delete it before or after upgrading. As such, I've included a more comprehensive set of reproduction steps to create the project from scratch, as opposed to providing an MRP.I tried reducing down the script to something even more minimal, but for whatever reason this particular script seems to force the problem.
Steps to reproduce
main.tscn
my_resource.gd
my_resource.gd
with the following contents:main.tscn
, call itmain.gd
main.gd
with the following contents:Parser Error: Could not find type "MyResource" in the current scope.
.godot
folderMinimal reproduction project (MRP)
N/A
The text was updated successfully, but these errors were encountered: