79435736

Date: 2025-02-13 10:01:20
Score: 0.5
Natty:
Report link

Found a strange but working solution (maybe it will be useful to someone): In the router.js file, you first need to preload the module synchronously (before const routes = [...]):

import ('microfront/page1').catch(...);

And then specify the route component as defineAsyncComponent:

{
    id: "page1",
    path: "/page1",
    name: "Page 1",
    component: defineAsyncComponent({
        loader: () => import("microfront/page1"),
        timeout: 10000,
        loadingComponent: Loading,
        errorComponent: ErrorPage,
    })
}
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Nikita