Figma plugin crashes: Plugin runtime aborted

Trying to export some nodes into their Uint8Array representation:

availableNodesArray.forEach(n => {
    const bytes = exportToBytes(n);
    //....do other stuff with bytes
})

const exportToBytes = async (node) => {
    return await node.exportAsync(node.exportSettings[0]);
};

According to debug logs, Figma seems to complete the forEach loop exporting each node to bytes, however at the end it just crashes.

Crash message in Figma UI: “Plugin runtime aborted”

Crash logs:

Aborted(Assertion failed: sh->header.ref_count == 0, at: /Users/rudi/figma/figma/jsvm-cpp/quickjs/quickjs.c,4383,js_free_shape0)

figma_app.esm.min.js.br:5 Error: Plugin runtime aborted
    at N (figma_app.esm.min.js.br:2985)
    at xNt._abortHandler (figma_app.esm.min.js.br:2985)
    at Object.sa.onAbort (figma_app.esm.min.js.br:2248)
    at abort (jsvm-cpp.js.br:9)
    at ___assert_fail (jsvm-cpp.js.br:9)
    at jsvm-cpp.wasm:0x2b0e2
    at jsvm-cpp.wasm:0x31b71
    at jsvm-cpp.wasm:0x23fa5
    at jsvm-cpp.wasm:0x3a74a
    at jsvm-cpp.wasm:0x26724
    at jsvm-cpp.wasm:0x33106
    at jsvm-cpp.wasm:0x2c352
    at jsvm-cpp.wasm:0x2bab3
    at jsvm-cpp.wasm:0x11f6
    at jsvm_runMicrotasksAndAutorelease (jsvm-cpp.wasm:0x6188)
    at figma_app.esm.min.js.br:2219

Not entirely sure what is going on here.

mmmm ok…nevermind…just closing and restarting figma and it all works just fine without any code change…interesting :thinking: