Skip to content

problem with creating surface #6897

Closed as not planned
Closed as not planned
@liagha

Description

@liagha

im trynna run wgpu on web using winit and wasm but i cant create a surface

panicked at src/window.rs:63:63:
called Result::unwrap() on an Err value: CreateSurfaceError { inner: Web("canvas.getContext() returned null; webgpu not available or canvas already in use") }

    let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
        backends: wgpu::Backends::all(),
        dx12_shader_compiler: Default::default(),
        flags: wgpu::InstanceFlags::default(),
        gles_minor_version: Default::default(),
    });

    let surface = instance.create_surface(window.clone()).unwrap();
    
    ive been trying to fix it for days but i havent figured it out yet

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions