{"record":{"id":"c38c5aca258a5490","repo":"toeverything/AFFiNE","slug":"error-fetching-embed","errorCode":null,"errorMessage":"Error fetching embed:","messagePattern":"Error fetching embed:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"blocksuite/affine/blocks/attachment/src/adapters/notion-html.ts","lineNumber":67,"sourceCode":"            while (embededURLSplit.length > 0) {\n              const key = assets\n                .getPathBlobIdMap()\n                .get(decodeURIComponent(embededURLSplit.join('/')));\n              if (key) {\n                blobId = key;\n                break;\n              }\n              embededURLSplit.shift();\n            }\n            const value = assets.getAssets().get(blobId);\n            if (value) {\n              name = getAssetName(assets.getAssets(), blobId);\n              size = value.size;\n              type = value.type;\n            }\n          } else {\n            const res = await fetch(embededURL).catch(error => {\n              console.warn('Error fetching embed:', error);\n              return null;\n            });\n            if (!res) {\n              return;\n            }\n            const resCloned = res.clone();\n            name =\n              getFilenameFromContentDisposition(\n                res.headers.get('Content-Disposition') ?? ''\n              ) ??\n              (embededURL.split('/').at(-1) ?? 'file') +\n                '.' +\n                (res.headers.get('Content-Type')?.split('/').at(-1) ?? 'blob');\n            const file = new File([await res.blob()], name, {\n              type: res.headers.get('Content-Type') ?? '',\n            });\n            size = file.size;\n            type = file.type;","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/blocksuite/affine/blocks/attachment/src/adapters/notion-html.ts#L49-L85","documentation":"Warning logged in the Notion HTML adapter when fetching the asset behind a Notion embed URL fails (network error, missing asset entry, or non-ok response). The embed's blob is not resolvable so the embed block is exported without its resolved content; conversion of the rest of the document continues.","triggerScenarios":"Triggered when the Notion HTML adapter fails to fetch an embedded asset URL while importing a Notion-exported HTML archive, so the attachment is skipped.","commonSituations":"Occurs during Notion import when external embed URLs are unreachable or blocked by network/CORS. Re-import with the asset files included in the export archive or check network access.","solutions":["Check the embed URL is reachable; retry the fetch.","Handle the fetch failure by skipping the embed."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b4c8548c09da21b2898443559a5b846f0ccf5dd8","analyzedAt":"2026-08-18T21:16:52.546Z","contentChangedAt":"2026-08-18T21:16:52.546Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}