Expected: a dataURL to save as an image of the board
Actual Behavior
Got: an error, and canvas becomes unresponsive. Error in console (using uncompressed FabricJS 5.1.0) is:
Uncaught DOMException: Failed to execute 'createPattern' on 'CanvasRenderingContext2D': The image argument is a canvas element with a width or height of 0.
at klass._applyPatternForTransformedGradient (http://localhost:8080/js/board/fabric.5.1.0.js:15923:30)
at klass._setStrokeStyles (http://localhost:8080/js/board/fabric.5.1.0.js:15662:18)
at klass._renderStroke (http://localhost:8080/js/board/fabric.5.1.0.js:15885:12)
at klass._renderPaintInOrder (http://localhost:8080/js/board/fabric.5.1.0.js:15828:14)
at klass._render (http://localhost:8080/js/board/fabric.5.1.0.js:19789:12)
at klass.drawObject (http://localhost:8080/js/board/fabric.5.1.0.js:15551:12)
at klass.render (http://localhost:8080/js/board/fabric.5.1.0.js:15409:14)
at klass.drawObject (http://localhost:8080/js/board/fabric.5.1.0.js:20360:26)
at klass.renderCache (http://localhost:8080/js/board/fabric.5.1.0.js:15424:14)
at klass.render (http://localhost:8080/js/board/fabric.5.1.0.js:15403:14)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Version
4.6.0 and higher
Test Case
https://jsfiddle.net/wilheim/3kvhzwbn/58/
Information about environment
Browser: Chrome and Firefox
Steps To Reproduce
2) Attempt canvas.toDataURL
Expected Behavior
Expected: a dataURL to save as an image of the board
Actual Behavior
Got: an error, and canvas becomes unresponsive. Error in console (using uncompressed FabricJS 5.1.0) is: