Open-EO / openeo-js-client

JavaScript and TypeScript client for the openEO API.
https://open-eo.github.io/openeo-js-client/latest/
Apache License 2.0
15 stars 6 forks source link

"axios is not defined" when using current development version #22

Closed jneijt closed 4 years ago

jneijt commented 4 years ago

Hi!

I've tried to update the js client to the beta 1.0 version to test it and came across the following error when trying to connect to a backend:

polyfills.js:3804 Unhandled Promise rejection: axios is not defined ; Zone: <root> ; Task: Promise.then ; Value: ReferenceError: axios is not defined at Connection._send (vendor.js:102461) at Connection._get (vendor.js:102386) at Connection.init (vendor.js:101947) at Function.connectDirect (vendor.js:103050) at Function.connect (vendor.js:103032) ReferenceError: axios is not defined at Connection._send (https://localhost:8100/vendor.js:102461:4) at Connection._get (https://localhost:8100/vendor.js:102386:21) at Connection.init (https://localhost:8100/vendor.js:101947:29) at Function.connectDirect (https://localhost:8100/vendor.js:103050:39) at Function.connect (https://localhost:8100/vendor.js:103032:23)

I'm using it in an Angular/Ionic setup, so I can't be 100% sure it's not due to some interference with those frameworks. However, adding another const axios = require('axios'); at the top of the connection.js file solved the issue for me.

Am I missing something here?

I've added the pull request I made for my local tests in case this is indeed the underlying issue and if don't have the change yet yourself.

m-mohr commented 4 years ago

Thanks for reporting, see PR #23 for details. :-) I'll issue another release this week, I hope.

m-mohr commented 4 years ago

@jneijt 1.0.0-beta.1 has been released. I hope it has no major issues. ;-)

jneijt commented 4 years ago

@m-mohr Great, thanks for the update! I'll check it out and let you know in case I run into anything ;-)