denoland/deno · error

path not found (entry missing): {}

Error message

path not found (entry missing): {}

What it means

Same embedded-VFS traversal, but the parent directory was reached successfully and the failure is in the final `entries.get_by_name(&component, case_sensitivity)` lookup: no entry with that exact name (honoring the configured case sensitivity) exists in that directory. It is the VFS equivalent of a plain "file not found" and is returned as `io::ErrorKind::NotFound` with the hint "(entry missing)".

Source

Thrown at cli/rt/file_system.rs:1306

                std::io::ErrorKind::NotFound,
                format!("path not found (symlink not dir): {}", path.display()),
              ));
            }
          }
        }
        _ => {
          return Err(std::io::Error::new(
            std::io::ErrorKind::NotFound,
            format!("path not found (not dir): {}", path.display()),
          ));
        }
      };
      let component = component.to_string_lossy();
      current_entry = current_dir
        .entries
        .get_by_name(&component, case_sensitivity)
        .ok_or_else(|| {
          std::io::Error::new(
            std::io::ErrorKind::NotFound,
            format!("path not found (entry missing): {}", path.display()),
          )
        })?
        .as_ref();
    }

    Ok((final_path, current_entry))
  }
}

pub struct FileBackedVfsFile {
  file: VirtualFile,
  pos: RefCell<u64>,
  vfs: Arc<FileBackedVfs>,
}

impl FileBackedVfsFile {

View on GitHub (pinned to 9ad36f7a2c)

Solutions

  1. Recompile with explicit `--include` globs covering every runtime-computed asset path (e.g. `deno compile --include="./config/**" -A main.ts`).
  2. Compare the exact casing of every path segment against the source tree — the embedded VFS is case-sensitive on Linux targets.
  3. Verify the path is inside the compile root; paths outside the VFS root fall back to the real filesystem and follow a different error path.

Example fix

# before
$ deno compile -A main.ts   # asset loaded at runtime via `./config/${env}.json` → entry missing

# after
$ deno compile -A --include="./config/**" main.ts
Defensive patterns

Strategy: try-catch

Validate before calling

// fail fast at startup for dynamically-built asset paths
const required = [`./config/${Deno.env.get("ENV")}.json`, "./data.bin"];
for (const p of required) {
  await Deno.stat(p); // surfaces missing VFS entries immediately with the path
}

Try / catch

try {
  return await Deno.readTextFile(p);
} catch (err) {
  if (err instanceof Deno.errors.NotFound) {
    return null; // missing embedded asset — degrade or recompile
  }
  throw err;
}

Prevention

When it happens

Trigger: Opening or stat-ing a path that was never embedded into the compiled binary: assets referenced only through runtime-computed strings (e.g. `./config/${env}.json`), wrong letter casing on a case-sensitive VFS (Linux default), or a file added to the repo after the binary was compiled.

Common situations: `deno compile` embeds only statically analyzable imports, so dynamically built paths are missing at runtime; developing on Windows/macOS (case-insensitive lookups succeed) then deploying to Linux (case-sensitive fails); running a stale binary after adding new asset files.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of denoland/deno@9ad36f7a2c (2026-08-20). Data as JSON: /api/errors/7ba1256a1862b95e. Report an issue: GitHub.