Skip to content

Cannot access error messages from device.popErrorScope #212

@mhawryluk

Description

@mhawryluk

Code to reproduce:

const redFragWGSL = `@fragment
fn main() -> @location(0) vec4f {
  return vec4(1.0, 0.0, 0.0, 1.0;
}`;

device.pushErrorScope('validation');
const redFragModule = device.createShaderModule({
  code: redFragWGSL,
});

const error = await device.popErrorScope();
if (error) {
  console.log('Error message: ', error.message);
}

Expected result:
same as when using WebGPU on the web

Error message:  Error while parsing WGSL: :3:33 error: expected ',' for function call
  return vec4(1.0, 0.0, 0.0, 1.0;
                                ^
 - While validating [ShaderModuleDescriptor]
 - While calling [Device].CreateShaderModule([ShaderModuleDescriptor]).

Current result:

Error message:  

Using react-native-wgpu error.message contains either an empty string or a few random characters instead of the actual error.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions