Skip to content

wasm web panics on iOS Safari with arg0.exitPointerLock is not a function #21497

@rectalogic

Description

@rectalogic

Bevy version and features

0.17.2

What you did

Simple Bevy app built using wasm-pack panics on startup in iOS 18.7.1 Safari:

[Error] wasm-bindgen: imported JS function that was not marked as `catch` threw an error: – "arg0.exitPointerLock is not a function. (In 'arg0.exitPointerLock()', 
[Error] TypeError: arg0.exitPointerLock is not a function. (In 'arg0.exitPointerLock()', 'arg0.exitPointerLock' is undefined)
[Error] panicked at /Users/aw/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/winit-0.30.12/src/platform_impl/web/event_loop/window_target.rs:582:26:
RefCell already borrowed

What went wrong

Panics on undefined function exitPointerLock

Additional information

Full reproduction is in this repo https://github.com/rectalogic/pointerlock

Load the app in iOS Safari via github pages here: https://rectalogic.com/pointerlock/

Connect to iOS Safari using macOS Safari dev tools:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-WindowingPlatform-agnostic interface layer to run your app inC-BugAn unexpected or incorrect behaviorO-WebSpecific to web (WASM) buildsO-iOSSpecific to the iOS mobile operating systemP-CrashA sudden unexpected crashP-RegressionFunctionality that used to work but no longer does. Add a test for this!

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions