Skip to content

🐞 Issue: Godot Dart Extension Loads, But Project Not Detected. #33

Open
@dexterBEN

Description

@dexterBEN

GOAL

I attempted to automate the setup of the Godot Dart extension using a devcontainer and a script (install.sh).

The goal was to verify that:

  • The extension compiles and loads correctly

  • A Dart project inside res://src/ is properly detected by Godot Editor

  • A minimal Dart script (hello_node.dart) runs correctly in Godot

Setup Details

  • OS: Ubuntu 22.04 (host), tested inside VSCode DevContainer and native environment
  • Godot: 4.4-stable (headless and GUI)
  • Dart: 3.7.x installed via APT (Google’s official channel)
  • Repository cloned with --recurse-submodules

Compilation of:

libgodot_dart.so via CMake ✅

libdart_dll.so via dart run build_runner build ✅

Dart bindings (godot_dart_scripts.g.dart) generated ✅

Directory structure:

isomap_godot_dart/
├── addons/
│   └── godot_dart/
│       ├── godot_dart.gdextension
│       ├── libdart_dll.so
│       └── libgodot_dart.so
├── src/
│   ├── pubspec.yaml
│   ├── lib/
│   │   ├── hello_node.dart
│   │   └── hello_node.g.dart
│   └── godot_dart_scripts.g.dart
├── project.godot
├── main.tscn

What Works
✅ Compilation steps succeed
✅ Editor launches using:

LD_LIBRARY_PATH=$PWD/addons/godot_dart:$LD_LIBRARY_PATH godot -e

✅ The extension loads — confirmed by this dialog:

The Godot Dart extension has been loaded in the project, but no Dart project was found.
Would you like to create a Dart project?

🚫 Problem

The extension does not detect the valid Dart project even though:

  • res://src/pubspec.yaml exists with a proper project name

  • lib/ and godot_dart_scripts.g.dart are present

  • build_runner completed successfully

  • The Dart script is attached to a node in a .tscn scene

Additionally:

  • Attempting to manually link the script in the scene fails silently

  • No "Hello from Dart" message ever prints in _ready()

Expected

  • When a valid Dart project with proper structure and generated bindings is present under res://src/, the editor should:

  • Recognize the project automatically

  • Not prompt to "Create Dart project"

  • Allow scripts like hello_node.dart to be attached and executed

Steps to Reproduce

  1. Clone repo with --recurse-submodules

  2. Run the automated setup script (see example below)

  3. Open Godot editor as shown

  4. Observe Dart project detection failure

Possible Causes

  • The extension might be expecting a specific folder or file pattern

  • pubspec.yaml parsing logic may be failing silently

  • Detection might rely on a .dart_tool folder or some build artifact that’s not well documented

Suggestion
Could you clarify:

  • What minimal structure or metadata is required for the extension to recognize a Dart project?

  • What path is expected for the Dart project: must it be exactly res://src/?

  • Does the name: in pubspec.yaml influence detection logic?

If helpful, I can provide:

Full install.sh i used

A sample clean project zip or GitHub repo

Thanks a lot for your work on this awesome bridge between Godot and Dart 🙏

Let me know if you'd like to include a GitHub Gist, file, or screenshots too — I can help write that part or clean it further.

Screenshot

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions