html2canvas works on firefox, not on chrome - html2canvas

I'm using the html2canvas module to make a screenshot of angular components made of d3.js and c3.js libraries to show charts.
Everything works fine in angular, the problem comes when i convert the angular components in custom elements and try to get the screenshot of the charts.
I get two different behaviors based on the browser using:
On Firefox I get in the console this error ERROR TypeError: this.ngElementStrategy is undefined but the screenshot works fine.
On Chrome I get this error SyntaxError: Error parsing CSS component value, unexpected EOF and the screenshot is not created.
My goal would be to make the library working also on chrome obviously; looking on the web the Chrome error should be related to a CSS class not supported by html2canvas, but i tried removing all the CSS imports from my test page and the error persists.
The different behaviors are strange assumed that in angular works but after the conversion to custom elements it doesn't only on chrome...
Anyone has any idea?

Related

Next JS + Material UI Warning: Prop className did not match

I am getting this error in the console, when I am using a specific custom component that uses Material UI.
I got the component from here.
Here is a sandbox with the error:
https://codesandbox.io/s/nostalgic-dream-nxg4e
The answers I found on the internet don't work, as most of them refer to a custom _document.tsx file configured for using Material UI with next js which I already set up.
I don't get the console error in production, but instead I get weird CSS behaviour.

Imprecise descriptions of bugs/exceptions when debugging EJS templates

EJS documentation at ejs.co says "It's easy to debug EJS errors: your errors are plain JavaScript exceptions, with template line-numbers included.".
However, when debugging the code with an bug in the template, I only get references to the functions inside my cza.js module that calls the ejs.renderFile and references to the "internal" errors within the EJS (ejs.js) itself. Reference to the bug within the .ejs template (ideally the line-number) is missing, in fact the template goes unmentioned.
So, the screenshot is of an the error within ejs.js, where EJS itself got stuck processing the bugged template, NOT the template itself, and so worthless:
So, how do I get the debugger to point out the bug in my template?
So, I have just found out that EJS does print out the code to terminal, unless a debugger does not step in to handle the exception before EJS can point out the bug.
In my scenario, I debug the app using node --inspect app.js, with debug auto-attach in VS Code enabled. The debugger then describes the exception as shown in the question screenshot.
How I found out the debugger was blocking EJS's output to terminal? I had a browser already requesting the app, when I launched it and the exception occured within the second before the debugger was attached.

Facebook page is not loading properly in mx:html (Adobe AIR) outside IDE

Adobe AIR application which was working perfectly earlier; is not working now. No idea whether it is due to any recent change in Facebook or Adobe AIR.
I have added the component mx:HTML to display http://facebook.com content. In the development environment (Flash Builder 4.5) after logging in facebook successfully; I can see the TimeLine contents and updates properly. But after build when executed outside the IDE; I am able to login facebook but the timeline or updates are not being displayed properly.
Anybody facing similar issue and has a fix; please provide the solution.
uncaughtScriptException gives following two errors...
TypeError: Result of expression 'bigPipe' [undefined] is not an object.
ReferenceError: Can't find variable: console
I have similar issue, if you catch the javascript errors you will notice that facebook is using some library that fails in AIR, then if you google that exact error you will find similar issues. My solution was to use the FB API and reimplement the functionality(in my case share) , other alternatives is to fix that library or FB code to make it work. I don't remember the details but I fixed it a week ago.
Check the docs for catching the JS errors uncaughtScriptException
I am wondering if that library has code for each browser that it supports and on AIR it fails, maybe changing useragent will help, you need to check the javascript code to see where it fails

Cannot Run HighChart GWT Demo Example - Area Range

I am trying to get an area chart in my application however, I cannot get even the most basic one displayed (I literally checked to see if their implementation would work but it doesnt and throws this error)
Example I tried to run http://www.moxiegroup.com/moxieapps/gwt-highcharts/showcase/#area-range
com.google.gwt.core.client.JavaScriptException: (TypeError)
#org.moxieapps.gwt.highcharts.client.BaseChart::nativeRenderChart(Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;ZZLcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;)([string:
'Chart', JavaScript object(10), bool: false, bool: false, JavaScript
object(36), JavaScript object(37), JavaScript object(38), JavaScript
object(26), JavaScript object(32), JavaScript object(25), JavaScript
object(30), JavaScript object(31), JavaScript object(34), JavaScript
object(35)]): $wnd.Highcharts is undefined
Is it possible im using the incorrect JQuery? Any and all help is greatly appreciated since this feature is important to our application
The reason for this error was that while I was including highcharts.js, i was not including highcharts-more.js. Including this solved my problem!!

symfony/zend integration - blank screen

I need to use ZendAMF on a symfony project and I'm currently working on integrating the two.
I have a frontend app with two modules, one of which is 'gateway' - the AMF gateway. In my frontend app config, I have the following in the configure function:
// load symfony autoloading first
parent::initialize();
// Integrate Zend Framework
require_once('[MY PATH TO ZEND]\Loader.php');
spl_autoload_register(array('Zend_Loader', 'autoload'));
The executeIndex function my the gateway actions.class.php looks like this
// No Layout
$this->setLayout(false);
// Set MIME Type
$this->getResponse()->setContentType('application/x-amf; charset='.sfConfig::get('sf_charset'));
// Disable cause this is a non-html page
sfConfig::set('sf_web_debug', false);
// Create AMF Server
$server = new Zend_Amf_Server();
$server->setClass('MYCLASS');
echo $server->handle();
return sfView::NONE;
Now when I try to visit the url for the gateway module, or even the other module which was working perfectly fine until this attempt, I only see a blank screen, with not even the symfony dev bar loaded. Oddly enough, my symfony logs are not being updated as well, which suggests that Synfony is not even being 'reached'.
So presumably the error has something to do with Zend, but I have no idea how to figure out what the error could be. One thing I do know for sure is that this is not a file path error, because if I change the path in the following line (a part of frontendConfiguration as shown above), I get a Zend_Amf_Server not found error. So the path must be correct. Also if I comment out this very same line, the second module resumes to normality, and my gateway broadcasts a blank x-amf stream.
spl_autoload_register(array('Zend_Loader', 'autoload'));
Does anyone have any tips on how I could attach this problem?
Thanks
P.S. I'm currently running an older version of Zend, which is why I am using Zend_Loader instead of Zend_autoLoader (I think). But I've tried switching to the new lib, but the error still remains. So it's not a version problem as well.
got it...
I was not using
set_include_path()
while loading Zend. It's still odd that it would give such a cryptic error, but this was the missing piece indeed.