• RuntimesGodotBugs
  • Can not export web build without errors with Godot and Spine2D

Hello, I’m trying to create a basic Godot project using Spine and export it to the web, but my export shows errors in the console:

-index.js:477 Error in loading dynamic library libspine_godot.web.template_release.wasm32.wasm: Error: libspine_godot.web.template_release.wasm32.wasm: file not found, and synchronous loading of external files is not available
-ERROR: Can't open dynamic library: bin/web/libspine_godot.web.template_release.wasm32.wasm. Error: Could not load dynamic lib: libspine_godot.web.template_release.wasm32.wasm
-index.js:477 Error: libspine_godot.web.template_release.wasm32.wasm: file not found, and synchronous loading of external files is not available.
-index.js:477 at: open_dynamic_library (platform/web/os_web.cpp:255)
-ERROR: Can't open GDExtension dynamic library: 'res://bin/spine_godot_extension.gdextension'.
-at: open_library (core/extension/gdextension.cpp:702)
-index.js:477 ERROR: Error loading extension: 'res://bin/spine_godot_extension.gdextension'.
-index.js:477 at: load_extensions (core/extension/gdextension_manager.cpp:291)
Godot Engine v4.4.1.stable.custom_build.49a5bc7b6 (2025-03-25 23:11:16 UTC) - https://godotengine.org
index.js:462 OpenGL API OpenGL ES 3.0 (WebGL 2.0 (OpenGL ES 3.0 Chromium)) - Compatibility - Using Device: WebKit - WebKit WebGL

To try to narrow down the issue, I downloaded a fresh version of the editor: v4.4.1.stable.official.

Following the instructions on https://en.esotericsoftware.com/spine-godot, I downloaded the spine-godot GDExtension for Godot 4.4.1, and placed the /bin folder at the root of the project, as indicated in the documentation. When I run the project in the editor, Spine works fine. The problem arises when exporting to the web.

After that, I installed the Export Templates for Windows, Linux, macOS, Web, Android, and iOS corresponding to version 4.4.1.

I also modified the lines in the spine_godot_extension.gdextension file from libgexample... to libspine_godot... as suggested in this post:
https://es.esotericsoftware.com/forum/d/28220-can-not-export-web-build-with-godot-and-spine2d/2

Before:
web.debug.threads.wasm32 = "web/libgexample.web.template_debug.wasm32.wasm"
web.release.threads.wasm32 = "web/libgexample.web.template_release.wasm32.wasm"
web.debug.wasm32 = "web/libgexample.web.template_debug.wasm32.nothreads.wasm"
web.release.wasm32 = "web/libgexample.web.template_release.wasm32.nothreads.wasm"

After:
web.debug.threads.wasm32 = "web/libspine_godot.web.template_debug.wasm32.wasm"
web.release.threads.wasm32 = "web/libspine_godot.web.template_release.wasm32.wasm"
web.debug.wasm32 = "web/libspine_godot.web.template_debug.wasm32.nothreads.wasm"
web.release.wasm32 = "web/libspine_godot.web.template_release.wasm32.nothreads.wasm"

I exported to Web with "Extensions Support" and "Thread Support" enabled, and I also selected "Use Custom Template", using the template I had previously downloaded and installed. (I also tried leaving this field empty since the templates are installed, but I got the same result.)

I’m not sure what I’m doing wrong. Could you help me get a working empty base project that doesn’t throw errors when using the Spine module as a GDExtension?

Related Discussions
...

To resolve the issue with exporting a web build using Godot and Spine2D, ensure that the paths in your spine_godot_extension.gdextension file are correctly pointing to the actual locations of the .wasm files. Verify that the libspine_godot.web.template_release.wasm32.wasm file exists in the specified directory. Additionally, make sure that the export templates for the web platform are correctly installed and that the paths in your project settings match the locations of these templates. If the problem persists, double-check that the Godot version you are using is compatible with the spine-godot runtime and that all necessary files are correctly placed in your project structure.

It looks like the spine_godot_extension.gdextension has an error in it. Please replace its contents with this:

[configuration]

entry_symbol = "spine_godot_library_init"
compatibility_minimum = "4.1"

[libraries]

macos.editor = "macos/libspine_godot.macos.editor.framework"
macos.debug = "macos/libspine_godot.macos.template_debug.framework"
macos.release = "macos/libspine_godot.macos.template_release.framework"

ios.debug = "ios/libspine_godot.ios.template_debug.framework"
ios.release = "ios/libspine_godot.ios.template_release.framework"

windows.editor.x86_64 = "windows/libspine_godot.windows.editor.x86_64.dll"
windows.debug.x86_64 = "windows/libspine_godot.windows.template_debug.x86_64.dll"
windows.release.x86_64 = "windows/libspine_godot.windows.template_release.x86_64.dll"

linux.editor.x86_64 = "linux/libspine_godot.linux.editor.x86_64.so"
linux.debug.x86_64 = "linux/libspine_godot.linux.template_debug.x86_64.so"
linux.release.x86_64 = "linux/libspine_godot.linux.template_release.x86_64.so"

linux.editor.arm64 = "linux/libspine_godot.linux.editor.arm64.so"
linux.debug.arm64 = "linux/libspine_godot.linux.template_debug.arm64.so"
linux.release.arm64 = "linux/libspine_godot.linux.template_release.arm64.so"

linux.editor.rv64 = "linux/libspine_godot.linux.editor.rv64.so"
linux.debug.rv64 = "linux/libspine_godot.linux.template_debug.rv64.so"
linux.release.rv64 = "linux/libspine_godot.linux.template_release.rv64.so"

android.debug.x86_64 = "android/libspine_godot.android.template_debug.x86_64.so"
android.release.x86_64 = "android/libspine_godot.android.template_release.x86_64.so"

android.debug.arm64 = "android/libspine_godot.android.template_debug.arm64.so"
android.release.arm64 = "android/libspine_godot.android.template_release.arm64.so"

web.debug.threads.wasm32 = "web/libspine_godot.web.template_debug.wasm32.wasm"
web.release.threads.wasm32 = "web/libspine_godot.web.template_release.wasm32.wasm"
web.debug.wasm32 = "web/libspine_godot.web.template_debug.wasm32.nothreads.wasm"
web.release.wasm32 = "web/libspine_godot.web.template_release.wasm32.nothreads.wasm"

I've created a minimal project you can check out:
http://mariozechner.at/uploads/test.zip

  • jvm님이 이에 답장했습니다.

    Mario

    Hi Mario, thank you very much for your response and help.

    I tried your example and it is exactly the same as mine. I checked the contents of spine_godot_extension.gdextension as you indicated and it was already the same.
    Just in case, I exported your sample project directly, and I still have the same problem. I've tried a thousand things but I can't find the solution.
    Are you able to export it without those errors appearing in the console? Maybe it's how I'm serving the game's HTML? Some important header missing or something like that.

    Hi @Mario , Can you think of anything else I can look at or where else I can investigate? I'm completely lost.

    I'm afraid I have no idea what could be the cause on your end. Did you try to export for HTML using the export settings in my test project?

    Oh, you might be on to something wrt to how you serve the game. For my test, i used python3 -m http.server in the directory I exported the test project to. I can then load the demo in the browser at http://localhost:8000.