Skip to content

deno compile binary not creating code cache if it imports a JSON or Wasm module #31766

@0f-0b

Description

@0f-0b
$ cat deno.json
{}
$ xxd empty.wasm
00000000: 0061 736d 0100 0000                      .asm....
$ cat main.ts
import "./deno.json" with { type: "json" };
import "./empty.wasm";
$ deno compile -o out main.ts
Check main.ts
Compile main.ts to out

Embedded Files

out
├── deno.json (3B)
├── empty.wasm (8B)
└── main.ts (248B)

Files: 1.84KB
Metadata: 1.36KB
Remote modules: 12B

$ DENO_LOG=debug ./out
DEBUG RS - denort::code_cache:57 - Failed to deserialize code cache from /var/folders/37/g0ks63l502v2hfj9y8nh219c0000gn/T/deno-compile-out.cache: No such file or directory (os error 2)
DEBUG RS - deno_lib::worker:908 - main_module file:///var/folders/37/g0ks63l502v2hfj9y8nh219c0000gn/T/deno-compile-out/main.ts
DEBUG RS - deno_runtime::worker:842 - received module evaluate Ok(
    (),
)
$ DENO_LOG=debug ./out
DEBUG RS - denort::code_cache:57 - Failed to deserialize code cache from /var/folders/37/g0ks63l502v2hfj9y8nh219c0000gn/T/deno-compile-out.cache: No such file or directory (os error 2)
DEBUG RS - deno_lib::worker:908 - main_module file:///var/folders/37/g0ks63l502v2hfj9y8nh219c0000gn/T/deno-compile-out/main.ts
DEBUG RS - deno_runtime::worker:842 - received module evaluate Ok(
    (),
)
$ deno --version
deno 2.6.3+7222e85 (canary, release, aarch64-apple-darwin)
v8 14.2.231.17-rusty
typescript 5.9.2

Logs show that the second run failed to read the code cache because the first run did not create it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    compilerelated to the `deno compile` featureneeds investigationrequires further investigation before determining if it is an issue or not

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions