react-to-print
react-to-print copied to clipboard
MS Edge Error: The operation was canceled by the user.
When we want to print table of images ( tags) then "Out of memory exception" on MS Edge it thrown.
Hi, and thanks for the report. Do you mind sharing some example code please for us to look at?
Hi @bhoroniecki Any chance you could update us on this please?
We are facing same issue. Was this resolved? Is there any alternate solution for this?
@ShreyaPrabhu any chance you could make a codepen or something please that shows a minimum reproduction of this? No one has posted any code examples so I don't even know where to begin looking for this one
Closing this as stale since there has been no response. Happy to re-open if someone provided more details.
I'm also seeing the same issue on edge. This is my code for App.js in a simple create-react-app
import React from 'react';
import ReactToPrint from 'react-to-print'
export default class App extends React.Component {
render () {
return (
<div className="App">
<header className="App-header">
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<div>
<ReactToPrint
trigger={() => <button>Print this out!</button>}
content={() => this.componentRef}
/>
<PrintComponent ref={el => (this.componentRef = el)} />
</div>
</header>
</div>
);
}
}
class PrintComponent extends React.Component {
render() {
return (
<table>
<img src="https://www.gstatic.com/webp/gallery3/1.png" />
<tbody>
<tr>
<td>data 1</td>
<td>data 2</td>
<td>data 3</td>
</tr>
</tbody>
</table>
)
}
}
I'm also seeing multiple messages saying "The operation was canceled by the user." Not sure if I'm just missing something but help would be appreciated! Thanks.
I am able to reproduce using your code on Edge via Browserstack.
The error is very vague.
SCRIPT 1223: The operation was cancelled by the user
So far the only related thing I've been able to find while searching is this: https://stackoverflow.com/questions/43378202/ms-edge-window-open-gives-error-the-operation-was-canceled-by-the-user
While we do open an iframe, we don't give it a url so I don't think that can be our problem. We do use canvas to load images, so it's possible there is an Edge specific problem there.
I have the same problem, for some reason the print mode opens and if I click "cancel" my page freezes. I could open the print window only if I set the copyStyles = {false} attribute if it is the true default, the print window does not open and the page freezes. I did not find any workaround for this so please if you have some way to fix this let me know. Thank you! (sorry for my bad English)
@mariagarciaflores to be sure, that's when using Edge, correct?
@MatthewHerbst I agree that it does seem to be an Edge specific issue as all other browsers seem to print fine. I was wondering if anyone has found a workaround to this issue? Or possibly some other approach?
@mariagarciaflores to be sure, that's when using Edge, correct?
Yes, it happens in Edge browser. Still trying to find some workaround. If you have something, it will be helpful.
Is this error still occurring? I'll try and take another stab at it if it's still a problem
Hi, I got the same problem not only Edge but also Opera. Firefox and Safari works well but Chrome may not render all iframes if the number is huge, and IE is the best. It crashes.
Also, there is a hacky solution for opera and chrome and probably edge. It is old but maybe works. https://stackoverflow.com/questions/1648594/print-iframe-content-in-opera-and-chrome
Chrome may not render all iframes if the number is huge
We only render/print a single iframe thankfully. Thanks for that link!
Have not had reports of this in some time. Going to close for now, please let me know if this is still an issue.