Skip to content
This repository has been archived by the owner on Jan 4, 2021. It is now read-only.

XMLHttpRequest is undefined using MyScript in a node application #21

Open
gruckion opened this issue Jun 9, 2019 · 2 comments
Open

Comments

@gruckion
Copy link

gruckion commented Jun 9, 2019

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;
@MyScriptSupport
Copy link

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

@MyScriptSupport
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants