I have a fresh project and I'm using the recommended Dockerfile. Ocasionally, when docker building, deno cache fails with this error:
error: invalid data
at https://deno.land/x/fresh@1.2.0/src/server/render.ts:1:32
running it again usually works. I'm guessing it could be a weird network error, but I'm having trouble pinpointing where it's coming from, and the error message could be better, I think. I don't understand where it comes from. I tried running it with --log-level debug but it doesn't help much. Here are two excerpts, one where it fails and one where it succeeds:
Download https://esm.sh/stable/preact@10.15.1/denonext/devtools.js
DEBUG RS - import_map:1102 - Specifier "https://esm.sh/stable/preact@10.15.1/denonext/preact.mjs" was not mapped in import map.
DEBUG RS - deno::npm::resolution:299 - Snapshot already up to date. Skipping pending resolution.
DEBUG RS - rustls::common_state:495 - Sending warning alert CloseNotify
DEBUG RS - rustls::common_state:495 - Sending warning alert CloseNotify
error: invalid data
at https://deno.land/x/fresh@1.2.0/src/server/render.ts:1:32
The command '/bin/sh -c deno cache main.ts --log-level debug' returned a non-zero code: 1
Download https://esm.sh/stable/preact@10.15.1/denonext/devtools.js
DEBUG RS - import_map:1102 - Specifier "https://esm.sh/stable/preact@10.15.1/denonext/preact.mjs" was not mapped in import map.
DEBUG RS - deno::npm::resolution:299 - Snapshot already up to date. Skipping pending resolution.
DEBUG RS - deno::module_loader:188 - Prepared module load.
DEBUG RS - rustls::common_state:495 - Sending warning alert CloseNotify
DEBUG RS - rustls::common_state:495 - Sending warning alert CloseNotify
Removing intermediate container c9d1053329ae
The line in the stacktrace is an import: import { renderToString } from "preact-render-to-string";. I have the following import map: "preact-render-to-string": "https://esm.sh/*preact-render-to-string@6.1.0".