When the node which you want to render has display: contents; property applied, the library unable to generate screenshot as the canvas size will be 0px/0px. It is caused by that the library depends on the .getBoundingClientRect() of the given node, but display:contents element do not have size.
When the node which you want to render has display: contents; property applied, the library unable to generate screenshot as the canvas size will be 0px/0px. It is caused by that the library depends on the .getBoundingClientRect() of the given node, but display:contents element do not have size.
The problem lies in create-context.ts
Here is an alternative implementation of getBoundingClientRect() which tries to fix the problems with display:contents elements.