diff --git a/packages/connect/src/core/onCallFirmwareUpdate.ts b/packages/connect/src/core/onCallFirmwareUpdate.ts index 3977270d8aca..94d18313109b 100644 --- a/packages/connect/src/core/onCallFirmwareUpdate.ts +++ b/packages/connect/src/core/onCallFirmwareUpdate.ts @@ -202,17 +202,27 @@ const getBinaryHelper = ( version: device.firmwareRelease.release.version, btcOnly, intermediaryVersion, - }).then(res => { - postMessage( - createUiMessage(UI.FIRMWARE_PROGRESS, { - device: device.toMessageObject(), - operation: 'downloading', - progress: 100, - }), - ); + }) + .then(res => { + console.log('res.byteLength', res.byteLength); + // suspiciously small binary. this typically happens when build does not have git lfs enabled and all + // you download here are some pointers to lfs objects + if (res.byteLength < 1000) { + throw ERRORS.TypedError('Runtime', 'Firmware binary is too small'); + } + return res; + }) + .then(res => { + postMessage( + createUiMessage(UI.FIRMWARE_PROGRESS, { + device: device.toMessageObject(), + operation: 'downloading', + progress: 100, + }), + ); - return res; - }); + return res; + }); }; const firmwareCheck = async (