{"record":{"id":"507071e678239425","repo":"denoland/deno","slug":"serde-v8-unknown-valuetype-for-v8-value","errorCode":null,"errorMessage":"serde_v8: unknown ValueType for v8::Value","messagePattern":"serde_v8: unknown ValueType for v8::Value","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"libs/serde_v8/payload.rs","lineNumber":41,"sourceCode":"      return Self::Bool;\n    } else if v.is_number() {\n      return Self::Number;\n    } else if v.is_string() {\n      return Self::String;\n    } else if v.is_array() {\n      return Self::Array;\n    } else if v.is_big_int() {\n      return Self::BigInt;\n    } else if v.is_array_buffer() {\n      return Self::ArrayBuffer;\n    } else if v.is_array_buffer_view() {\n      return Self::ArrayBufferView;\n    } else if v.is_object() {\n      return Self::Object;\n    } else if v.is_null_or_undefined() {\n      return Self::Null;\n    }\n    panic!(\"serde_v8: unknown ValueType for v8::Value\")\n  }\n}\n","sourceCodeStart":23,"sourceCodeEnd":44,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/libs/serde_v8/payload.rs#L23-L44","documentation":"serde_v8 classifies a v8::Value into a ValueType by walking a chain of type checks (Array, BigInt, ArrayBuffer, view, Object, null/undefined, and earlier branches). This panic is the exhaustive-match guard: the value passed none of the checks. With a well-formed handle from a live isolate it is unreachable; it fires only when the handle is invalid, stale, or of a v8 kind this serde_v8 version does not know.","triggerScenarios":"Passing a v8::Local obtained from a different or already-disposed isolate; using a handle after GC collected the object; running a serde_v8/deno_core build whose version predates a value kind added in the vendored v8.","commonSituations":"Embedder bugs that store Locals across isolate teardown; mismatched deno_core/serde_v8/v8 versions in Cargo.lock; FFI code fabricating handles.","solutions":["Ensure every v8 handle passed to serde_v8 comes from the same live isolate and an active HandleScope","Align deno_core, serde_v8, and the v8 crate versions in your lockfile","In ops, take v8 values as arguments managed by deno_core instead of storing Locals yourself","If versions are aligned and it still fires, report upstream with a reproducer - a v8 kind may be missing from the branch list"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":"use deno_core::v8;\n\nenum ValueType { Number, Boolean, String, Symbol, Array, BigInt, ArrayBuffer, ArrayBufferView, Object, Null }\n\nfn classify(v: v8::Local<v8::Value>) -> Option<ValueType> {\n  if v.is_number() { Some(ValueType::Number) }\n  else if v.is_boolean() { Some(ValueType::Boolean) }\n  else if v.is_string() { Some(ValueType::String) }\n  else if v.is_symbol() { Some(ValueType::Symbol) }\n  else if v.is_array() { Some(ValueType::Array) }\n  else if v.is_big_int() { Some(ValueType::BigInt) }\n  else if v.is_array_buffer() { Some(ValueType::ArrayBuffer) }\n  else if v.is_array_buffer_view() { Some(ValueType::ArrayBufferView) }\n  else if v.is_object() { Some(ValueType::Object) }\n  else if v.is_null_or_undefined() { Some(ValueType::Null) }\n  else { None } // would panic in serde_v8 - reject here instead\n}","tryCatchPattern":"let classified = std::panic::catch_unwind(|| serde_v8::classify(value));\nif classified.is_err() {\n  // treat as an isolate/handle-lifetime bug: log, drop the handle, keep the process alive\n}","preventionTips":["Never store v8::Local handles beyond their HandleScope; re-acquire from persistent handles inside the owning isolate","Keep deno_core, serde_v8, and the vendored v8 crate versions in lockstep","Treat this panic as evidence of a memory-safety-adjacent bug, not a recoverable condition"],"tags":["serde-v8","v8","isolate","handle-lifetime","panic"],"backgroundTag":"unknown-value-type","analyzedSha":"9ad36f7a2cce60488e6ec52283efb32efddaf93a","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}