Skip to content

[BUG]: Image Example returns a Unhandled Rejection: TypeError: Only escpos.Image supported at: [object Promise] #442

Description

@abdallahkhaliid

Description of the bug

I'm trying to print this example

printer.align('ct')
.image(image, 's8')
.then(() => {
printer.cut()
.close();
});

my implementation

const imagePath = path.join(__dirname, '/assets/apple-icon.png');

escpos.Image.load(imagePath, function (image) {
  device.open(function () {
    printer
      .align('ct')
      .image(image, 's8')
      .then(() => {
        printer.cut().close();
      });
  });
});

i get

❌ error:
Unhandled Rejection: TypeError: Only escpos.Image supported at: [object Promise]

Steps To Reproduce

empty

Additional Information

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions