godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.88k stars 21.02k forks source link

`--import` still produces errors `SCRIPT ERROR: Parse Error: Could not find base class` #93424

Open MikeSchulze opened 3 months ago

MikeSchulze commented 3 months ago

Tested versions

v4.3.beta2.mono.official.b75f0485b

System information

Windows 11

Issue description

I have created a new plugin with custom classes using class_name. By nature, the ".godot" folder is not transferred to a repository, so Godot should recreate the cache.

But even --import does not work as specified ;) This means that if the .godot folder is missing, Godot will show these error messages SCRIPT ERROR: Parse Error: Could not find base class when first started.

This kind of error is already a long term problem, and it frustrates me that this cache error has feeling no focus. I would expect the editor to have its own cache under control and rebuild it when needed. This should be the default, without the hassle of having to use a workaround like --import.

Steps to reproduce

Use the attached project Two scenarios: a) delete the .godot folder open in Godot editor, you see the errors at startup

Godot Engine v4.3.beta2.mono.official (c) 2007-present Juan Linietsky, Ariel Manzur & Godot Contributors.
--- Debug adapter server started on port 6006 ---
--- GDScript language server started on port 6005 ---
  res://addons/GeometryNodes/src/ui/nodes/CsgMeshNode.tscn::GDScript_ostj1:2 - Parse Error: Could not find base class "GeometryGraphNode".
  res://addons/GeometryNodes/src/ui/nodes/OutputNode.tscn::GDScript_o1pkp:2 - Parse Error: Could not find base class "GeometryGraphNode".
  res://addons/GeometryNodes/src/io/GeometryNodeGraphResourceLoader.gd:41 - Invalid call. Nonexistent function 'deserialize' in base 'GraphNode ()'.
  Failed loading resource: res://addons/GeometryNodes/src/GeometryNode3D.ngph. Make sure resources have been imported by opening the project in the editor at least once.

b) delete the .godot folder use command line $GODOT_BIN --import --headless

Godot Engine v4.3.beta2.mono.official.b75f0485b - https://godotengine.org

ERROR: Mouse is not supported by this display server.
   at: (servers/display_server.cpp:497)
SCRIPT ERROR: Parse Error: Could not find base class "GeometryGraphNode".
          at: GDScript::reload (res://addons/GeometryNodes/src/ui/nodes/CsgMeshNode.tscn::GDScript_ostj1:2)
SCRIPT ERROR: Parse Error: Could not find base class "GeometryGraphNode".
          at: GDScript::reload (res://addons/GeometryNodes/src/ui/nodes/OutputNode.tscn::GDScript_o1pkp:2)
SCRIPT ERROR: Invalid call. Nonexistent function 'deserialize' in base 'GraphNode ()'.
          at: GeometryNodeGraphResourceLoader._load (res://addons/GeometryNodes/src/io/GeometryNodeGraphResourceLoader.gd:41)
ERROR: Failed loading resource: res://addons/GeometryNodes/src/GeometryNode3D.ngph. Make sure resources have been imported by opening the project in the editor at least once.
   at: (core/io/resource_loader.cpp:281)
WARNING: 1 RID of type "Canvas" was leaked.
     at: _free_rids (servers/rendering/renderer_canvas_cull.cpp:2483)
WARNING: 8 RIDs of type "CanvasItem" were leaked.
     at: _free_rids (servers/rendering/renderer_canvas_cull.cpp:2485)
ERROR: 1 RID allocations of type 'N16RendererViewport8ViewportE' were leaked at exit.
ERROR: 17 RID allocations of type 'PN13RendererDummy14TextureStorage12DummyTextureE' were leaked at exit.
ERROR: 51 RID allocations of type 'PN18TextServerAdvanced22ShapedTextDataAdvancedE' were leaked at exit.
ERROR: 1 RID allocations of type 'PN18TextServerAdvanced12FontAdvancedE' were leaked at exit.
WARNING: ObjectDB instances leaked at exit (run with --verbose for details).
     at: cleanup (core/object/object.cpp:2284)
ERROR: 3 resources still in use at exit (run with --verbose for details).
   at: clear (core/io/resource.cpp:589)

Minimal reproduction project (MRP)

GeometryNodes.zip

FallenAngel97 commented 3 months ago

Hello, this also happening to my project, I created a minimal reproduction project here: https://github.com/FallenAngel97/godot-example-reimport The error looks like this: image

The plugin is this one: https://github.com/KoBeWi/Godot-Slider-Label

The temporary workaround discussed with blackshift from Godot is following (considering that you don't have the .godot folder present yet):

godot -v --headless -e --quit godot -v --headless -e --quit # <-- double to ensure that we have everything in place from imports godot -v --headless --export-release Android ./example.aab