wix-fetch fetch() function hitting endpoint twice

I’ve noticed while trying to use the fetch() function in client side “Page” code AND in a server-side Web Module that it is hitting the endpoint twice for each invocation… The page I have been using to test this on, once it was discovered, is an empty page with this very basic JS… Can anyone imagine why this would be happening?

import {fetch} from ‘wix-fetch’;

$w.onReady( function () {
let getAccessTokenReq = “{test-endpoint-goes-here}”;

 **let**  options =   { 
                           method  :'POST',  
                           body    :'Hello World' 
                       } 
 console.log( 
      fetch(getAccessTokenReq, options).then(response => response.json()) 
 ); 

});

Hello Reis

My guess is that that console log is having some unexpected side effects.

Instead of:

console.log(
         fetch(getAccessTokenReq, options).then(response => response.json())
    );

Try this snippet:

fetch(getAccessTokenReq, options)
    .then(response => response.json())
    .then((parsedResponse) => {
        console.log("parsed response: ", parsedResponse);
    }).catch((err) => {
        console.log("error: ", err);
    })

In the new case it should return 1 console.log (fetch once) statement regardless of if it fails or succeeds.

Goodluck,
Majd