#"invalid data" error when using deno cache

10 messages · Page 1 of 1 (latest)

floral geode
#

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".

#

How can I figure out where the "invalid data" message is coming from? I don't see it in deno's repository nor in fresh's repository. Is it cause by import erroring out trying to download that preact render to string file, or something?

oblique panther
#

Running into this same issue for fresh@1.2.0 as well as for twind@0.16.19 intermittently.

deno 1.34.3 (release, aarch64-apple-darwin)
v8 11.5.150.2
typescript 5.0.4

$ uname -a
Darwin MacBook-Pro-8.engenius.login 22.5.0 Darwin Kernel Version 22.5.0: Thu Jun  8 22:22:20 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T6000 arm64

Thanks in advance!

narrow sage
#

happening to me too. a simple create new fresh 1.2.0 app showing "invalid data". Quite frustrating as I was thinking of using fresh for starting my project.

$ deno --version
deno 1.35.0 (release, aarch64-apple-darwin)
v8 11.6.189.7
typescript 5.1.6

$ uname -a
Darwin MacBook-Pro.local 22.4.0 Darwin Kernel Version 22.4.0: Mon Mar  6 20:59:28 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T6000 arm64
cyan tinsel
#

I can reproduce it on one of my machines now too. Going to look into it but I can't fathom this being an issue with fresh itself. Will keep you posted once I have news

cyan tinsel
#

For some reason I can't reproduce that anymore :S

narrow sage
#

But well now it can't run haha sigh

#

owh ok it works after deno cache --reload main.ts

#

the latest try was to change back one by one to add * and run
deno cache --reload && deno task start everytime and now it suddenly works fine now with default settings. wow. such a weird thing.