{"record":{"id":"1b983fab587b0dde","repo":"denoland/deno","slug":"path-exists","errorCode":null,"errorMessage":"{path} exists","messagePattern":"(.+?) exists","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"libs/core/runtime/bindings.rs","lineNumber":314,"sourceCode":"      original_sources.into_boxed_slice(),\n      lazy_source_specifiers,\n    )\n  }\n}\n\npub(crate) fn get<'s, 'i, T>(\n  scope: &mut v8::PinScope<'s, 'i>,\n  from: v8::Local<'s, v8::Object>,\n  key: FastStaticString,\n  path: &'static str,\n) -> T\nwhere\n  v8::Local<'s, v8::Value>: TryInto<T>,\n{\n  let key = key.v8_string(scope).unwrap();\n  from\n    .get(scope, key.into())\n    .unwrap_or_else(|| panic!(\"{path} exists\"))\n    .try_into()\n    .unwrap_or_else(|_| panic!(\"unable to convert\"))\n}\n\n/// Create an object on the `globalThis` that looks like this:\n/// ```ignore\n/// globalThis.Deno = {\n///   core: {\n///     ops: {},\n///   },\n///   // console from V8\n///   console,\n///   // wrapper fn to forward message to V8 console\n///   callConsole,\n/// };\n/// ```\npub(crate) fn initialize_deno_core_namespace<'s, 'i>(\n  scope: &mut v8::PinScope<'s, 'i>,","sourceCodeStart":296,"sourceCodeEnd":332,"githubUrl":"https://github.com/denoland/deno/blob/336da420f4343cbb1dcbd5eed9d075ff555ed6ee/libs/core/runtime/bindings.rs#L296-L332","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["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)","Make RuntimeOptions::extensions identical (same set and order) to the extension list passed to create_snapshot that produced the snapshot","Remove any global_object_middlewares or startup scripts that delete or replace the Deno / Deno.core globals","Pin one deno_core version across the snapshot producer and consumer (workspace-wide version lock)"],"exampleFix":"// before: snapshot generated by an older deno_core; bootstrap globals missing\nlet rt = JsRuntime::new(RuntimeOptions {\n  startup_snapshot: Some(&STALE_SNAPSHOT),\n  ..Default::default()\n}); // panics: 'Deno.core.ops exists'\n\n// after: regenerate the snapshot in build.rs with the linked deno_core\n// (create_snapshot with the same extensions), then boot from that blob\nlet rt = JsRuntime::new(RuntimeOptions {\n  startup_snapshot: Some(&REGENERATED_SNAPSHOT),\n  ..Default::default()\n});","handlingStrategy":"validation","validationCode":"// Canary check in CI: prove the snapshot boots with this binary before shipping.\nfn snapshot_boots(blob: &[u8]) -> bool {\n  JsRuntime::try_new(RuntimeOptions {\n    startup_snapshot: Some(blob),\n    ..Default::default()\n  }).is_ok()\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Regenerate the startup snapshot whenever deno_core, deno_runtime, or the extension list changes","Keep exactly one deno_core version in the workspace so producer and consumer cannot diverge","Never delete or rename Deno / Deno.core / Deno.core.ops in startup scripts or global_object_middlewares","Run a snapshot smoke test (boot one runtime) in CI for every binary+snapshot pair"],"tags":["deno-core","v8","runtime-init","snapshot","panic","globalthis"],"backgroundTag":"runtime-initialization-failed","analyzedSha":"336da420f4343cbb1dcbd5eed9d075ff555ed6ee","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}