denoland/deno · critical

{path} exists

Error message

{path} exists

What it means

deno_core's bindings::get() helper fetches mandatory global properties (globalThis.Deno, Deno.core, Deno.core.ops, timer callbacks, error constructors) while a JsRuntime or realm is initialized (call sites at bindings.rs:435, bindings.rs:734, jsruntime.rs:1704+). The panic "{path} exists" fires when the property lookup returns None, i.e. the expected global is missing at that exact path. It is an internal invariant: the bootstrap JavaScript that creates these globals, usually baked into the startup snapshot, did not run or produced a different global shape.

Source

Thrown at libs/core/runtime/bindings.rs:314

      original_sources.into_boxed_slice(),
      lazy_source_specifiers,
    )
  }
}

pub(crate) fn get<'s, 'i, T>(
  scope: &mut v8::PinScope<'s, 'i>,
  from: v8::Local<'s, v8::Object>,
  key: FastStaticString,
  path: &'static str,
) -> T
where
  v8::Local<'s, v8::Value>: TryInto<T>,
{
  let key = key.v8_string(scope).unwrap();
  from
    .get(scope, key.into())
    .unwrap_or_else(|| panic!("{path} exists"))
    .try_into()
    .unwrap_or_else(|_| panic!("unable to convert"))
}

/// Create an object on the `globalThis` that looks like this:
/// ```ignore
/// globalThis.Deno = {
///   core: {
///     ops: {},
///   },
///   // console from V8
///   console,
///   // wrapper fn to forward message to V8 console
///   callConsole,
/// };
/// ```
pub(crate) fn initialize_deno_core_namespace<'s, 'i>(
  scope: &mut v8::PinScope<'s, 'i>,

View on GitHub (pinned to 336da420f4)

Solutions

  1. Regenerate the startup snapshot with the exact deno_core build linked into the consuming binary (rerun the build.rs create_snapshot step and load the fresh blob)
  2. Make RuntimeOptions::extensions identical (same set and order) to the extension list passed to create_snapshot that produced the snapshot
  3. Remove any global_object_middlewares or startup scripts that delete or replace the Deno / Deno.core globals
  4. Pin one deno_core version across the snapshot producer and consumer (workspace-wide version lock)

Example fix

// before: snapshot generated by an older deno_core; bootstrap globals missing
let rt = JsRuntime::new(RuntimeOptions {
  startup_snapshot: Some(&STALE_SNAPSHOT),
  ..Default::default()
}); // panics: 'Deno.core.ops exists'

// after: regenerate the snapshot in build.rs with the linked deno_core
// (create_snapshot with the same extensions), then boot from that blob
let rt = JsRuntime::new(RuntimeOptions {
  startup_snapshot: Some(&REGENERATED_SNAPSHOT),
  ..Default::default()
});
Defensive patterns

Strategy: validation

Validate before calling

// Canary check in CI: prove the snapshot boots with this binary before shipping.
fn snapshot_boots(blob: &[u8]) -> bool {
  JsRuntime::try_new(RuntimeOptions {
    startup_snapshot: Some(blob),
    ..Default::default()
  }).is_ok()
}

Prevention

When it happens

Trigger: Calling JsRuntime::new (or creating a JsRealm) with a startup snapshot that was built without the deno_core bootstrap globals; a global_object_middleware or startup script that deletes/renames Deno, Deno.core or Deno.core.ops before initialization reads them; consuming a snapshot produced by a different deno_core version whose init script creates differently named globals.

Common situations: Embedding deno_core with a custom snapshot generated in build.rs that skipped the default extensions/bootstrap scripts; upgrading deno_core or deno_runtime without regenerating the snapshot; tests that construct runtimes with a trimmed or reordered extension list; forking a codebase that pins the snapshot blob in a separate artifact from the binary.

Related errors


AI-assisted analysis of denoland/deno@336da420f4 (2026-08-20). Data as JSON: /api/errors/1b983fab587b0dde. Report an issue: GitHub.