{"record":{"id":"3ac36940593e8da7","repo":"quasarframework/quasar","slug":"received-an-unregistered-chunk","errorCode":null,"errorMessage":"Received an unregistered chunk.","messagePattern":"Received an unregistered chunk\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"app-vite/exports/bex/private/bex-bridge.js","lineNumber":694,"sourceCode":"\n    if (packet.type === 'full') {\n      this.#onMessage({\n        id: packet.id,\n        from: packet.from,\n        to: packet.to,\n        payload: packet.payload,\n        type: packet.messageType,\n        props: packet.messageProps\n      })\n      return\n    }\n\n    if (packet.type === 'chunk') {\n      const chunk = this.chunkMap[packet.id]\n\n      if (chunk === void 0) {\n        if (packet.chunkIndex !== void 0) {\n          this.warn('Received an unregistered chunk.', packet)\n          return\n        }\n\n        this.chunkMap[packet.id] = {\n          portName: packet.from,\n          number: packet.chunksNumber,\n          messageType: packet.messageType,\n          messageProps: packet.messageProps,\n          payload: []\n        }\n        return\n      }\n\n      // if we received an unexpected chunk\n      if (packet.chunkIndex !== chunk.payload.length) {\n        this.warn('Received an out of order chunk.', packet)\n\n        // free up resources","sourceCodeStart":676,"sourceCodeEnd":712,"githubUrl":"https://github.com/quasarframework/quasar/blob/4841521b5f635a971eb9e2710e5542efd194691b/app-vite/exports/bex/private/bex-bridge.js#L676-L712","documentation":"The bridge received a chunk-type packet whose id is not in chunkMap and which carries a chunkIndex, meaning it's a continuation of a chunked message whose first packet was never registered (or was already consumed/deleted). The bridge warns and drops the packet.","triggerScenarios":"An intermediate chunk arrives for a transfer that was already finalized/aborted (e.g. after the out-of-order cleanup deleted the entry), or packets were dropped/reordered across ports; duplicate sends sharing the same chunk id.","commonSituations":"Very large payloads being chunked while the receiving side restarted (service worker wake-up) losing chunkMap state; slow receivers hitting the out-of-order path first, making subsequent chunks 'unregistered'.","solutions":["Re-send the whole message from the sender when this warning appears (the transfer is unrecoverable).","Keep the receiving context alive during large transfers (avoid service-worker suspension, keep ports active).","Reduce payload size or raise chunk size configuration so fewer packets are exchanged.","Ensure unique message ids per transfer to avoid collisions."],"exampleFix":"// before\nbridge.send('big-event', hugeArrayBuffer) // transfer interrupted, chunks orphaned\n// after\ntry {\n  bridge.send('big-event', hugeArrayBuffer)\n} catch {\n  bridge.send('big-event', hugeArrayBuffer) // resend restores a fresh chunk id\n}","handlingStrategy":"retry","validationCode":"// keep payload modest and receiver alive during transfer\nconst MAX_SAFE_SIZE = 32 * 1024 * 1024\nif (payload.byteLength > MAX_SAFE_SIZE) {\n  throw new Error('Payload too large for reliable bridge transfer')\n}","typeGuard":"const isTransferable = (p) => p instanceof ArrayBuffer || typeof p === 'string' || (p && typeof p === 'object')","tryCatchPattern":"try {\n  bridge.send('big-event', payload)\n} catch (err) {\n  // chunk state is lost; resend from scratch\n  bridge.send('big-event', payload)\n}","preventionTips":["Avoid sending multiple large chunked messages concurrently.","Prevent service worker suspension during transfers.","Reduce payload sizes to minimize chunking."],"tags":["bex","extension","chunking","packet-loss"],"backgroundTag":"chunk-transfer-out-of-sync","analyzedSha":"4841521b5f635a971eb9e2710e5542efd194691b","analyzedAt":"2026-08-30T01:13:14.944Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}