{"record":{"id":"61d50db1cf960e5e","repo":"denoland/deno","slug":"object-is-not-a-valid-image-or-a-path-to-an-image","errorCode":null,"errorMessage":"Object is not a valid image or a path to an image. `Deno.jupyter.image` supports displaying JPG or PNG images, or GPUTextures.","messagePattern":"Object is not a valid image or a path to an image\\. `Deno\\.jupyter\\.image` supports displaying JPG or PNG images, or GPUTextures\\.","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"cli/js/40_jupyter.js","lineNumber":413,"sourceCode":"  if (isJpg(obj)) {\n    return makeDisplayable({\n      \"image/jpeg\": core.ops.op_base64_encode_from_buffer(obj, 0, obj.length),\n    });\n  }\n\n  if (isPng(obj)) {\n    return makeDisplayable({\n      \"image/png\": core.ops.op_base64_encode_from_buffer(obj, 0, obj.length),\n    });\n  }\n\n  if (obj instanceof GPUTexture) {\n    return makeDisplayable({\n      \"image/png\": core.ops.op_jupyter_create_png_from_texture(obj),\n    });\n  }\n\n  throw new TypeError(\n    \"Object is not a valid image or a path to an image. `Deno.jupyter.image` supports displaying JPG or PNG images, or GPUTextures.\",\n  );\n}\n\nfunction isMediaBundle(obj) {\n  if (obj == null || typeof obj !== \"object\" || Array.isArray(obj)) {\n    return false;\n  }\n  for (const key in obj) {\n    if (typeof key !== \"string\") {\n      return false;\n    }\n  }\n  return true;\n}\n\nasync function formatInner(obj, raw) {\n  if (raw && isMediaBundle(obj)) {","sourceCodeStart":395,"sourceCodeEnd":431,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/cli/js/40_jupyter.js#L395-L431","documentation":"The downloaded, checksum-verified cache directory for the backend does not contain the expected backend binary — the archive's internal layout does not match what the binary locator expects for that backend/target.","triggerScenarios":"Version skew: a laufey release changed its archive layout while this Deno build expects the previous one; or the cache directory was manually rearranged/truncated after extraction.","commonSituations":"Using an outdated Deno against a newer laufey release; users pruning or editing the cache by hand; partially deleted cache from a crashed run.","solutions":["Delete the cached laufey directory for that backend/target and re-run to force a clean re-download","Update Deno to a version matching the current laufey release layout","If it persists on the latest version, report a bug including backend, target, and Deno version"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const binary = join(laufeyCacheDir, backend, expectedBinaryName(target));\nif (!await exists(binary)) {\n  await Deno.remove(laufeyCacheDir, { recursive: true }).catch(() => {}); // force clean re-download\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never manually rearrange the laufey cache directory","Keep Deno updated so archive-layout expectations track laufey releases","After a Deno upgrade, clear the laufey cache once to avoid stale-shape archives"],"tags":["desktop","laufey","cache","layout","version-skew"],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}