MyScriptJS
MyScriptJS copied to clipboard
XMLHttpRequest is undefined using MyScript in a node application
trafficstars
When attempting to import "myscript"; to use in a REST API the XMLHttpRequest instance in undefined.
Assumption was made:
// We are writing some browser module here so the no import found should be ignored
// eslint-disable-next-line no-undef
var request = new XMLHttpRequest();
In order to fix this the dependencies needs to be introduced.
var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
Dear Gruckion,
Thank you for contacting us and pointing this.
We will check this internally, and see if we update the samples accordingly.
Best regards,
Olivier
Dear Gruckion,
currently, our library is to be used on browser side only, not on server side. On server side with Node, you shall directly use the REST API.
Best regards,
Olivier