I'm attempting to retrieve the distance between two locations using the TomTom API.
Unfortunately, I am facing an issue with Protractor:
When trying to use the *fetch function - I receive an error stating "fetch is not defined" and it advises me to use import instead.
Upon attempting to use *import, another error arises: "Cannot use import statement outside of module."
After adding { type: module } to package.json, Protractor ceases to function properly as the entire code is now recognized as a module of ES.
Additionally, when utilizing *browser.get, a JSON data page opens up but I encounter difficulty extracting the information from it.
Is there an alternative method I can explore? I've tried importing the JSON to a separate file and exporting response.data, however, the module error prevents me from proceeding with this approach as well.