You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<scriptlang="ts">import{ Camera }from'web-gphoto2';letcamera=newCamera();asyncfunctionconnect(){console.log('Connecting to camera');awaitCamera.showPicker();console.log('Camera picked');awaitcamera.connect();console.log('Connected to camera');}asyncfunctiondisconnect(){awaitcamera.disconnect();console.log('Disconnected from camera');}</script><buttonon:click={connect}on:keydown={connect}>Connect</button><buttonon:click={disconnect}on:keydown={disconnect}>Disconnect</button>
Steps to reproduce the issue:
Basic
Click connect and pick the camera
Click disconnect
Click connect and pick the camera
Crash
Full
Click connect
Console: Connecting to camera
Select the camera from the device picker
Console: Camera picked
Console: Connected to camera
Click disconnect
Console: Disconnected from camera
Click connect
Console: Connecting to camera
Select the camera from the device picker
Console: Camera picked
Console Error: Bindingerror
Console Error: BindingError (Click for full log)
{
"name": "BindingError",
"message": "Cannot use deleted val. handle = 0",
"stack": "BindingError: Cannot use deleted val. handle = 0\n at Error. (http://localhost:5173/node_modules/web-gphoto2/build/libapi.mjs?v=a6df64ee:9:103581)\n at new (http://localhost:5173/node_modules/web-gphoto2/build/libapi.mjs?v=a6df64ee:9:103398)\n at throwBindingError (http://localhost:5173/node_modules/web-gphoto2/build/libapi.mjs?v=a6df64ee:9:104022)\n at Object.toValue (http://localhost:5173/node_modules/web-gphoto2/build/libapi.mjs?v=a6df64ee:9:132432)\n at __emval_get_property (http://localhost:5173/node_modules/web-gphoto2/build/libapi.mjs?v=a6df64ee:9:144427)\n at http://localhost:5173/node_modules/web-gphoto2/build/libapi.wasm:wasm-function[189]:0xb47e\n at http://localhost:5173/node_modules/web-gphoto2/build/libapi.wasm:wasm-function[1183]:0x8b5f8\n at http://localhost:5173/node_modules/web-gphoto2/build/libapi.wasm:wasm-function[402]:0x2b342\n at http://localhost:5173/node_modules/web-gphoto2/build/libapi.wasm:wasm-function[1223]:0x90fd8\n at http://localhost:5173/node_modules/web-gphoto2/build/libapi.wasm:wasm-function[2090]:0x11c09d"
}
Console Error: Memory access out of bounds
Console Error: RuntimeError: memory access out of bounds (Click for full log)
Uncaught (in promise) RuntimeError: memory access out of bounds
at libapi.wasm:0xe8f9d
at ret. (libapi.mjs?v=a6df64ee:9:125609)
at Object.doRewind (libapi.mjs?v=a6df64ee:9:126898)
at libapi.mjs?v=a6df64ee:9:127491
The text was updated successfully, but these errors were encountered:
In the libapi.mjs I made the constructor async so it took care of connection too, but now the API suggests you can connect/disconnect same instance multiple times.
That's not the case as disconnect runs destructor and frees the C++ instance.
Code to reproduce the issue
This is the minimal (Svelte) reproduction:
Steps to reproduce the issue:
Basic
Full
Connecting to camera
Camera picked
Connected to camera
Disconnected from camera
Connecting to camera
Camera picked
Console Error: BindingError (Click for full log)
{ "name": "BindingError", "message": "Cannot use deleted val. handle = 0", "stack": "BindingError: Cannot use deleted val. handle = 0\n at Error. (http://localhost:5173/node_modules/web-gphoto2/build/libapi.mjs?v=a6df64ee:9:103581)\n at new (http://localhost:5173/node_modules/web-gphoto2/build/libapi.mjs?v=a6df64ee:9:103398)\n at throwBindingError (http://localhost:5173/node_modules/web-gphoto2/build/libapi.mjs?v=a6df64ee:9:104022)\n at Object.toValue (http://localhost:5173/node_modules/web-gphoto2/build/libapi.mjs?v=a6df64ee:9:132432)\n at __emval_get_property (http://localhost:5173/node_modules/web-gphoto2/build/libapi.mjs?v=a6df64ee:9:144427)\n at http://localhost:5173/node_modules/web-gphoto2/build/libapi.wasm:wasm-function[189]:0xb47e\n at http://localhost:5173/node_modules/web-gphoto2/build/libapi.wasm:wasm-function[1183]:0x8b5f8\n at http://localhost:5173/node_modules/web-gphoto2/build/libapi.wasm:wasm-function[402]:0x2b342\n at http://localhost:5173/node_modules/web-gphoto2/build/libapi.wasm:wasm-function[1223]:0x90fd8\n at http://localhost:5173/node_modules/web-gphoto2/build/libapi.wasm:wasm-function[2090]:0x11c09d" }Console Error: RuntimeError: memory access out of bounds (Click for full log)
Uncaught (in promise) RuntimeError: memory access out of bounds at libapi.wasm:0xe8f9d at ret. (libapi.mjs?v=a6df64ee:9:125609) at Object.doRewind (libapi.mjs?v=a6df64ee:9:126898) at libapi.mjs?v=a6df64ee:9:127491The text was updated successfully, but these errors were encountered: