Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with IE browser #3

Open
madhu-aithal opened this issue Jan 23, 2019 · 3 comments
Open

Compatibility with IE browser #3

madhu-aithal opened this issue Jan 23, 2019 · 3 comments

Comments

@madhu-aithal
Copy link

If I try to use this telemetry SDK in Internet Explorer browser (I am using IE 11), I am getting the below error

ERROR TypeError: Object doesn't support this action

Below is the complete stacktrace of the error

TypeError: Object doesn't support this action
   at libraryDispatcher.dispatch (http://localhost:4200/vendor.js:67373:13)
   at Anonymous function (http://localhost:4200/vendor.js:67727:25)
   at Anonymous function (http://localhost:4200/vendor.js:67859:21)
   at Anonymous function (http://localhost:4200/assets/js/telemetry.js:4525:17)
   at Anonymous function (http://localhost:4200/assets/js/telemetry.js:4759:21)
   at ZoneDelegate.prototype.invokeTask (http://localhost:4200/polyfills.js:7945:13)
   at onInvokeTask (http://localhost:4200/vendor.js:49534:17)
   at ZoneDelegate.prototype.invokeTask (http://localhost:4200/polyfills.js:7945:13)
   at Zone.prototype.runTask (http://localhost:4200/polyfills.js:7718:21)
   at ZoneTask.invokeTask (http://localhost:4200/polyfills.js:8021:17)```
@manjudr
Copy link
Member

manjudr commented Jan 23, 2019

@madhu-aithal I
Is library dispatcher instance is available? Are you overriding the library dispatcher ? what configurations are you passing ?

@madhu-aithal
Copy link
Author

madhu-aithal commented Jan 23, 2019

@manjudr
I am not overriding the library dispatcher. I am passing values for uid, pdata, batchsize, host, endpoint, apislug (empty value), env in the configuration object.

@madhu-aithal
Copy link
Author

@manjudr
When I debugged the issue, I found out it was because of dispatching custom events (line 18 of telemetryV3Interface.js). CustomEvent does not seem to work in IE browsers.

So If I make the following change in line 18 of telemetryV3Interface.js, it is working fine.

Before
document.dispatchEvent(new CustomEvent('TelemetryEvent', { detail: event }));

After
const customEvent = document.createEvent("CustomEvent"); customEvent.initCustomEvent('TelemetryEvent', false, false, { detail: event, }); document.dispatchEvent(customEvent);

I have also created a pull request for the same. Please let me know if it is correct.

swatigoel referenced this issue in mosip/sunbird-telemetry-sdk Sep 18, 2023
[INJI-251] Customize Telemetry SDK to be compatible with INJI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants