Figma plugin crashes: Plugin runtime aborted

Trying to export some nodes into their Uint8Array representation:

availableNodesArray.forEach(n => {
    const bytes = exportToBytes(n);
    // 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) Error: Plugin runtime aborted
    at N (
    at xNt._abortHandler (
    at (
    at abort (
    at ___assert_fail (
    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)

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: