Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaScriptObject example code doesn't work #93703

Closed
anniryynanen opened this issue Jun 28, 2024 · 0 comments · Fixed by #93750
Closed

JavaScriptObject example code doesn't work #93703

anniryynanen opened this issue Jun 28, 2024 · 0 comments · Fixed by #93750

Comments

@anniryynanen
Copy link
Contributor

anniryynanen commented Jun 28, 2024

Tested versions

  • Reproduces in v4.3.beta2.official [b75f048]
  • Doesn't reproduce in v4.2.2.stable.official [15073af]

System information

Windows 10.0.22631 - GLES3 (Compatibility) - AMD Radeon RX 7700 XT (Advanced Micro Devices, Inc.; 31.0.24033.1003) - AMD Ryzen 7 5700X3D 8-Core Processor (16 Threads)

Issue description

The example code in https://docs.godotengine.org/en/latest/classes/class_javascriptobject.html#class-javascriptobject throws the following error:

Error calling constructor ArrayBuffer with args: 
Array [ 10n ]
 error: TypeError: can't convert BigInt to number
    _godot_js_wrapper_create_object http://localhost:8060/tmp_js_export.js:13437
    Godot http://localhost:8060/tmp_js_export.js:596
    callMain http://localhost:8060/tmp_js_export.js:15658
    Engine http://localhost:8060/tmp_js_export.js:16562
    Engine http://localhost:8060/tmp_js_export.js:16557
    promise callback*start http://localhost:8060/tmp_js_export.js:16536
    Engine http://localhost:8060/tmp_js_export.js:16595
    promise callback*startGame http://localhost:8060/tmp_js_export.js:16594
    <anonymous> http://localhost:8060/tmp_js_export.html:181
    <anonymous> http://localhost:8060/tmp_js_export.html:195
USER SCRIPT ERROR: Attempt to call function 'create_object' in base 'JavaScriptBridge' on a null instance. tmp_js_export.js:16235:18
   at: _init (res://main.gd:7) tmp_js_export.js:16235:18

I'm guessing JavaScriptBridge has changed since 4.2.2 and the documentation hasn't been updated yet. I'd like to use the bridge, what's the best way to find out how?

Steps to reproduce

Run MRP in a browser.

Minimal reproduction project (MRP)

js-test.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Release Blocker
Development

Successfully merging a pull request may close this issue.

2 participants