Repository: godot
Issue: `--import` still produces errors `SCRIPT ERROR: Parse Error: Could not find base class`
Labels: bug,topic:plugin

### 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
```bash
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`
```bash
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](https://github.com/user-attachments/files/15925577/GeometryNodes.zip)