Upgrading to v6 from v5 and have routes issue

In v5 I used to do this:

{
    path: '/settings/',
    viewName: 'main',
    async: async ({ resolve }) => {
      const module = await import('../components/user/ProfileSettingsPage');
      const component = module.default;
      resolve({ component });
    }
  }

But that fails with something about a component does not return a function. So I changed to this:

{
    path: '/settings/',
    viewName: 'main',
    async: async ({ resolve }) => {
      const module = await import('../components/user/ProfileSettingsPage');
      const component = () => module.default;
      resolve({ component });
    }
  }

But then F7 is just broken. :confused:

Any ideas?

That should work, at least just checked with Kitchen Sink, and it works without problem. You can also try to use asyncComponent instead which is for dynamically imports like so:

{
  path: '/settings/',
  viewName: 'main',
  asyncComponent: () => import('../components/user/ProfileSettingsPage')
}

I still get errors like this:

How to replicate/see it?