I am trying to use the ews-javascript-api in a web application, but as it seems to be based on Nodejs I am unable to get the scripts to run properly. I added requirejs, but now I get the error "Uncaught Error: Module name "../ExchangeWebService" has not been loaded yet for context: _. Use require([])"
Is is possible to access the ExchangeWebService.js file from a web browser and if so, how do I get the dependencies set up correct?
Not easy though. Microsoft does not implement CORS on Exchange Server and Chrome must use CORS pre-flight for you to access exchange server. if you are working on enterprise application using ews-javascript-api, you can use some proxy in middle which would override CORS restriction and you can then use it in Chrome. for testing purpose if you disable CORS in Chrome, you can use it. nginx or even IIS can be used to override this limitation, not sure your use case.
you have to use specifically built module https://github.com/gautamsi/ews-js-api-browser to use with browser based access.