Async router redirect issue

The router in v7 used to allow the following when doing a redirect from within an async route:

async({ resolve }) {
    resolve({ url: '/abc/' });
}

It is also in documentation:

resolve method of route callback has the following format:

resolve(parameters, options)

  • parameters object - object with resolved route content. Must contain one of url, content, component or componentUrl properties
  • options object - object with Route Options

Now it does not work and one has to do the following:

async({ router, reject }) {
    reject();
    router.navigate('/abc/');
}

Just want to know if this is by design?

There werent changes in v8 related to this. It should work the same

if this line:

router.navigate('/abc/');

works for you, then ‘/abc/’ is a path.

if ‘/abc/’ is a path, then this line:

resolve({ url: '/abc/' });

will never work, it must be something like:

resolve({ url: 'actual/physical/location/of/file.html' });
1 Like

Yes you are right. I was reading and reconstructing the code incorrectly from a previous commit in the repo. Thanks.