You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been trying to test the Javascript error reporting (automatic or manually caught) using the async method suggested in the documentation, and although it works like charm in Firefox 57.0.1, I had to do a major tweak and disable the sync load to make it work in Chrome 62.0.3202.94.
Instead of the suggested method for loading the library, I had to do the following:
<scriptsrc="//cdn.jsdelivr.net/gh/AppEnlight/[email protected]/appenlight-client.min.js"></script><scripttype="text/javascript">varinitAppEnlight=function(){if(this.readyState!=='loading'){AppEnlight.init({apiKey: '{{ APPENLIGHT_KEY }}',windowOnError: 1// enable to hook to window.onerror});// setting request info is completly optionalAppEnlight.setRequestInfo({server: '{{ SERVER_HOSTNAME }}',username:'{{ request.user.username }}',{%ifrequest.META.HTTP_X_FORWARDED_FOR%}ip: '{{ request.META.HTTP_X_FORWARDED_FOR }}',{%else%}ip: '{{ request.META.REMOTE_ADDR }}',{%endif%}// request_id:"server_generated_uuid"});}};initAppEnlight();</script>
Previous to that each time I called the AppEnlight GrabError() or Log() functions I got 'AppEnlight is not defined" error on Chrome's debug console.
I'm not a JS developer so I'm not sure if the tweak I did is the right thing to do, or if there is a better way to overcome my issue with Chrome.
Thanks, and please keep going with the good work!
Erasmo
The text was updated successfully, but these errors were encountered:
I think async was not supported in firefox so thats why it worked, and in chrome the rest of the code was executed before the library loaded. I'll take a look at this. Thanks.
Hello:
I have been trying to test the Javascript error reporting (automatic or manually caught) using the async method suggested in the documentation, and although it works like charm in Firefox 57.0.1, I had to do a major tweak and disable the sync load to make it work in Chrome 62.0.3202.94.
Instead of the suggested method for loading the library, I had to do the following:
Previous to that each time I called the AppEnlight GrabError() or Log() functions I got 'AppEnlight is not defined" error on Chrome's debug console.
I'm not a JS developer so I'm not sure if the tweak I did is the right thing to do, or if there is a better way to overcome my issue with Chrome.
Thanks, and please keep going with the good work!
Erasmo
The text was updated successfully, but these errors were encountered: