fathyb / html2svg

Convert HTML and `<canvas>` to SVG, PDF, or images using Chromium

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crashes with Angular applications

luastoned opened this issue · comments

Hi, below is the command and output when trying to convert https://angular.io

λ docker run --rm fathyb/html2svg https://angular.io/ > angular.svg
Internal server error TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received an instance of Object
    at new NodeError (node:internal/errors:372:5)
    at Function.from (node:buffer:325:9)
    at html2svg (/app/build/html2svg.js:78:23)
    at async /app/build/html2svg.server.js:33:28 {
  code: 'ERR_INVALID_ARG_TYPE'
}
Error: Server error 500
    at printRequest (/app/build/html2svg.cli.js:88:15)
    at ClientRequest.<anonymous> (/app/build/html2svg.cli.js:73:38)
    at ClientRequest.emit (node:events:513:28)
    at HTTPParser.parserOnIncomingClient (node:_http_client:693:27)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:117:17)
    at Socket.socketOnData (node:_http_client:534:22)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Readable.push (node:internal/streams/readable:234:10)

Ah, this was caused by Zone.js overriding Promise.. A fix has been published on the latest 1.0.0 release. Thanks for the report!