{"record":{"id":"7730b5a8c6104912","repo":"gfx-rs/wgpu","slug":"only-available-on-webgpu","errorCode":null,"errorMessage":"Only available on WebGPU","messagePattern":"Only available on WebGPU","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"wgpu/src/backend/wgpu_core.rs","lineNumber":2844,"sourceCode":"impl dispatch::BufferMappedRangeInterface for CoreBufferMappedRange {\n    #[inline]\n    fn len(&self) -> usize {\n        self.size\n    }\n\n    #[inline]\n    unsafe fn read_slice(&self) -> &[u8] {\n        unsafe { slice::from_raw_parts(self.ptr.as_ptr(), self.size) }\n    }\n\n    #[inline]\n    unsafe fn write_slice(&mut self) -> WriteOnly<'_, [u8]> {\n        unsafe { WriteOnly::new(NonNull::slice_from_raw_parts(self.ptr, self.size)) }\n    }\n\n    #[cfg(webgpu)]\n    fn as_uint8array(&self) -> &js_sys::Uint8Array {\n        panic!(\"Only available on WebGPU\")\n    }\n}\n","sourceCodeStart":2826,"sourceCodeEnd":2847,"githubUrl":"https://github.com/gfx-rs/wgpu/blob/3e11ff59bf3f9795d285ecc045014089640d7248/wgpu/src/backend/wgpu_core.rs#L2826-L2847","documentation":"Panic in the core buffer-mapped-range's as_uint8array: this method only exists to serve the WebGPU (browser) backend, where mapped memory is a JS Uint8Array; on a native core buffer there is no such array to return, so the trait method is an unreachable stub.","triggerScenarios":"Thrown at wgpu/src/backend/wgpu_core.rs:2844 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use read_slice()/write_slice() to access native mapped memory instead of as_uint8array","Only call as_uint8array behind a webgpu backend check"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3e11ff59bf3f9795d285ecc045014089640d7248","analyzedAt":"2026-09-03T01:43:21.459Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T07:17:11.731Z"}