Thursday, May 26, 2016

ArcGIS Javascript v3.16 Crash Issue on Chrome 51

Google Chrome 51 breaks ArcGIS Javascript API with an error 'Uncaught Reference error: normal is not defined'. This page will guide you how to fix it.
Recently, I update Google Chrome to version 51 and noticed that my web application developed with ArcGIS Javascript API is crashed from startup. The error message is:

'Uncaught Reference error: normal is not defined'

After spending time on researching the cause of problem. I found that the root cause is come from window.getComputedStyle function of Google Chrome which return CSS 'content' attribute = "normal" as default value instead of empty string.

So, to fix problem, I add condition to detect whenever ArcGIS Javascript API call function window.getComputedStyle. Right now I see that there are 2 files so far that call this function:
1. \js\arcgisonline\arcgisonline.js
2. \arcgis_js_api\library\3.16\3.16\xstyle\css.js

Image below show the added code in red rectangle:


After I added code, my web app run perfectly as it used to be on Google Chrome 51 again.

Note that is solution only fix the problem in short term. You should wait for ESRI Inc. to release patch for this problem.


Happy Coding!

No comments:

Post a Comment