Skip to content

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

@abdallahkhaliid

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions