bpmn-io / bpmn-to-image

Convert BPMN 2.0 diagrams to PDF documents or PNG files.
62 stars 38 forks source link

Integer value expected #10

Closed KaiqueBressi closed 5 years ago

KaiqueBressi commented 5 years ago

Hello, I'm facing the following problem when trying to use the bpmn-to-image inside Docker, it only happens with an especific bpmn file. Trying to debug it i have noticied that the width coming from desiredViewport on index.js line 34 is not integer, it's a float. What about putting a round() before calling setViewport ?

Error: Protocol error (Emulation.setDeviceMetricsOverride): Invalid parameters width: integer value expected
    at Promise (/usr/local/share/.config/yarn/global/node_modules/puppeteer/lib/Connection.js:183:56)
    at new Promise (<anonymous>)
    at CDPSession.send (/usr/local/share/.config/yarn/global/node_modules/puppeteer/lib/Connection.js:182:12)
    at EmulationManager.emulateViewport (/usr/local/share/.config/yarn/global/node_modules/puppeteer/lib/EmulationManager.js:41:20)
    at Page.setViewport (/usr/local/share/.config/yarn/global/node_modules/puppeteer/lib/Page.js:763:54)
    at Page.<anonymous> (/usr/local/share/.config/yarn/global/node_modules/puppeteer/lib/helper.js:111:23)
    at printDiagram (/usr/local/share/.config/yarn/global/node_modules/bpmn-to-image/index.js:52:8)
    at processTicksAndRejections (internal/process/task_queues.js:86:5)
pinussilvestrus commented 5 years ago

Thanks for reporting! We are always open for contributions, e.g. by opening Pull Requests which improves the situation 👍

KaiqueBressi commented 5 years ago

Thanks @pinussilvestrus, I opened the Pull Request, can you check this out?

pinussilvestrus commented 5 years ago

Closed via 5102b82e0f87d79d3a7dfd820d4efb440c89b12b