Comments (15)
can't we just get a 2.9.2 to fix this, it's been checked in #42
from dom-to-image-more.
also happens in my react project
from dom-to-image-more.
If anyone's working on 2.8.0 (from that StackOverflow solution), and wants the fix for #29, I have something for you!
Modify the dom-to-image-more file inside your node-modules to include the solution. There's no version between 2.8.0
and 2.9.1
, so this'll make do.
Replace the cloneStyle()
function with this block of code
` function cloneStyle() {
copyStyle(window.getComputedStyle(original), clone.style);
function copyStyle(source, target) {
if (source.cssText) {
target.cssText = source.cssText;
target.font = source.font; // here, we re-assign the font prop.
} else copyProperties(source, target);
function copyProperties(source, target) {
util.asArray(source).forEach(function(name) {
target.setProperty(
name,
source.getPropertyValue(name),
source.getPropertyPriority(name)
);
});
}
if (root) {
['inset-block', 'inset-block-start', 'inset-block-end'].forEach((prop) => target.removeProperty(prop));
['left', 'right', 'top', 'bottom'].forEach((prop) => {
if (target.getPropertyValue(prop)) {
target.setProperty(prop, '0px');
}
});
}
}
}`
This will work until you run npm/update packages (I think). I can fork this if anyone else is running into the same niche bug.
from dom-to-image-more.
@barboite were you able to fix this issue?
from dom-to-image-more.
@talhaamjadx mmhhh, tried to paste this in my node_modules/dom-to-image-more/src/dom-to-image-more.js
and re-built my front. It doesn't work, still the same error. Am i supposed to re-install deps with npm ? i'm not familiar with modifying inside node_modules
from dom-to-image-more.
The latest commits also contain a unreleased fix for the Karma test workflow. Any ETA on release @IDisposable?
from dom-to-image-more.
Should be fixed in v2.9.4
from dom-to-image-more.
Unfortunately it's not fixed with v2.9.4 - the problem persits as mentioned in #42 . Downgrading to v2.8.0 solves the problem and is still working properly without TypeError in my project.
from dom-to-image-more.
Can you please point me at a source code reproduction of this issue?
from dom-to-image-more.
Also I hate to be "that techie" but could you confirm the cache been sufficiently cleared to ensure that it was indeed 2.9.4 throwing the error?
from dom-to-image-more.
Also I hate to be "that techie" but could you confirm the cache been sufficiently cleared to ensure that it was indeed 2.9.4 throwing the error?
Thanks for your hint.
Procedure, starting from a flawless Angular v13 project (no error running v2.8.0):
=> npm i dom-to-image-more@latest => clearing browser-cache => restarting dev-server => failure with TypeError
=> npm i [email protected] => restarting dev-server => project is running flawlessly again
Any objections?
from dom-to-image-more.
Could you paste that TypeError log here?
from dom-to-image-more.
Could you paste that TypeError log here?
The TypeError is mentioned in #42.
from dom-to-image-more.
Fixed in v2.9.5, sorry for the inability to test before...
from dom-to-image-more.
Closing since nobody has complained that v2.9.5 didn't fix this more than a year ago :)
from dom-to-image-more.
Related Issues (20)
- Can I use this library without npm or module? Just plain html HOT 2
- On firefox toPng returns empty image HOT 1
- make it posible to shift
- Icon to image display failed HOT 1
- TypeError: Cannot read properties of undefined (reading 'setProperty')
- Error using toPng with extra quote in HTML
- The internal picture is blank HOT 2
- border HOT 10
- Cannot convert webgl
- Need embed fonts to be optional
- Browser crashes when using toPng
- Image is cropped in Firefox HOT 3
- cssRules from google CSS breaking HOT 1
- TypeError:Failed to execute 'readAsDataURL' on 'FileReader' : parameter 1 is not of type 'Blob' HOT 7
- Bug: get wrong pic from image jsp
- domtoimage doesn't work on vector layer
- Exporting blank image when element's parent has visibility hidden
- Dom-to-image conversion results misaligned content in Image for CSS flex styles
- domtoImage converts only first child element when cloneNode(true) is used
- Unavaible to override existing CSS style within the adjustClone function HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dom-to-image-more.