dom-to-image
dom-to-image copied to clipboard
toPng() throw error.
Event {
"isTrusted": true,
"bubbles": false,
"cancelBubble": false,
"cancelable": false,
"composed": false,
"currentTarget": null,
"defaultPrevented": false,
"eventPhase": 0,
"returnValue": true,
"srcElement": null,
"target": null,
"timeStamp": 16799.799999952316,
"type": "error"
}
Any solution found for the above ?
你好,我已收到你的来信。辛苦了!!
Same error here (using html-to-image, forked from dom-to-image)
I noticed the error was occurring because of an img
tag with empty src
attribute.
e.g <img class="layer" id="film" src="" />
From my experience, the error rised from bootstrap 4.5 :
Copy works when I delete the svg background url.
Css code :
.custom-select { display: inline-block; width: 100%; height: calc(1.5em + .75rem + 2px); padding: .375rem 1.75rem .375rem .75rem; font-size: 1rem; font-weight: 400; line-height: 1.5; color: #495057; vertical-align: middle; background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .75rem center/8px 10px; border: 1px solid #ced4da; border-radius: .25rem; -webkit-appearance: none; -moz-appearance: none; appearance: none }
I have also encountered this problem. Has it been solved?
had the same issue,how did you solve it?
Event { "isTrusted": true, "bubbles": false, "cancelBubble": false, "cancelable": false, "composed": false, "currentTarget": null, "defaultPrevented": false, "eventPhase": 0, "returnValue": true, "srcElement": null, "target": null, "timeStamp": 16799.799999952316, "type": "error" }
had the same issue,how did you solve it?
It is normal when there is an external network, but in the absence of an external network environment, the wrong content is reported:
Event {isTrusted: true, type: 'error', target: img, currentTarget: img, eventPhase: 2, …}isTrusted: truebubbles: falsecancelBubble: falsecancelable: falsecomposed: falsecurrentTarget: nulldefaultPrevented: falseeventPhase: 0path: Array(1)0: imgaccessKey: ""align: ""alt: ""ariaAtomic: nullariaAutoComplete: nullariaBusy: nullariaChecked: nullariaColCount: nullariaColIndex: nullariaColSpan: nullariaCurrent: nullariaDescription: nullariaDisabled: nullariaExpanded: nullariaHasPopup: nullariaHidden: nullariaInvalid: nullariaKeyShortcuts: nullariaLabel: nullariaLevel: nullariaLive: nullariaModal: nullariaMultiLine: nullariaMultiSelectable: nullariaOrientation: nullariaPlaceholder: nullariaPosInSet: nullariaPressed: nullariaReadOnly: nullariaRelevant: nullariaRequired: nullariaRoleDescription: nullariaRowCount: nullariaRowIndex: nullariaRowSpan: nullariaSelected: nullariaSetSize: nullariaSort: nullariaValueMax: nullariaValueMin: nullariaValueNow: nullariaValueText: nullassignedSlot: nullattributeStyleMap: StylePropertyMap {size: 0}attributes: NamedNodeMap {0: src, src: src, length: 1}