CORS issue on resolve in async route

I’m encountering an issue I never encountered in my previous app while working with Framework7 v5 and I just can’t understand what might be causing this in v6

The rearranged code is this:

name: 'single_buoni',
path: '/buoni/:buonoId/',
async: function ({ app, to, resolve }) {

  app.request.post(url, {
    action: 'rsWpApi/getBuono',
    id: to.params.buonoId,
    ajax: true
  }, function (data) {
    var buono = JSON.parse(data).data;
    resolve({
      componentUrl: './pages/buono.html',
    }, {
      props: {
        buono: buono,
      }
    });
  }, function () {
    sendToast('<i class="f7-icons">close</i>', "Si è verificato un errore");
  });
}

Once I get to the resolve part of the code, I get errors in console relative to CORS. I have no idea why CORS could be generating here. Any tip would be really appreciated!

If it is a Cordova iOS app you need to properly set app host and protocol (check Cordova docs for this)

Thank you for the pointer

yes I’m indeed using iOS, but is this what you’re talking about?

immagine

It’s the only thing I believe refers to access limitations in the app, but it is configured just like it was before and never had issues with it. I’m using cordova ios 6.2 which should include wk engine by default if that helps

1 Like

No, it should be something like:

<preference name="scheme" value="app" />
<preference name="hostname" value="localhost" />

Oh I see, never used these. Thank you that did it!