Skip to content

Uncaught (in promise) Error: Operation cancelled #616

@paulsmirnov

Description

@paulsmirnov

Describe the bug
The error Uncaught (in promise) Error: Operation cancelled is generated when you load a file while the previous load is in progress. This must be a kind warning rather than an uncaught exception.

To Reproduce
Steps to reproduce the behavior:

  1. Edit 'miew_via_global.html' example to add another loading call after init.
  2. Open the HTML file in a browser and check the console.
  3. See the error
      var viewer = new Miew({
        container: document.getElementsByClassName('miew-container')[0],
        load: '1CRN',
      });

      if (viewer.init()) {
        viewer.load('4XN6');  // <-- the added line
        viewer.run();
      }

Expected behavior
No uncaught exceptions happen. A warning is produced instead.

Screenshots

Image

Desktop:

  • OS: Windows 11
  • Browser: Chrome 140.0.7339.208 (Official Build) (64-bit)
  • Version: Miew v0.11.0 and the latest main branch

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behavior

    Type

    No fields configured for Bug.

    Projects

    Status
    To do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions