Skip to content

On web, opening the print dialog (File > Print...) panics #3579

@maximetinu

Description

@maximetinu

This debug_assert! is hit when opening the browser's print dialog

Steps to reproduce

  • Open any simple web app that uses Winit. For example, a Bevy game (can be reproduced in Bevy's examples, like here: https://bevyengine.org/examples/2D%20Rendering/move-sprite/)
  • Open the print dialog of the browser. In Google Chrome, it is File > Print... or pressing Ctrl+P or Cmd+P
  • Alternatively, you can call print() in the JS console

Expected behaviour

Printing the pixels of canvas, inside the web, at the exact moment of opening the Print dialog, would be ideal. In fact, it's the current behaviour (+ the panic).

It'd be preferable to not show the canvas at all, or to show it as black, rather than crashing.

Actual behaviour

Printing the current frame kind of works:

image

But then, it panics with the following stack trace:

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions