Invalid react-loadable

Environment: webpack4 react and others are the latest dependencies!

import React from "react";
import {
  BrowserRouter,
  Route,
  Link,
  Switch,
  HashRouter
} from "react-router-dom"

import Loadable from "react-loadable";
import Loading from "./loading.jsx";
//
import App from "../app.jsx";

//  

//demos   
import Demo from "../pages/demos/demo.jsx";

//pages
import Search from "../store/container/searchContainer";
import ShopDetail from "../store/container/shopDetailContainer";
import AllShopList from "../pages/allShopList/allShopList.jsx";
import BrandDetail from "../pages/brandDetail/brandDetail.jsx";
import CouponDetail from "../store/container/couponDetailContainer";
import MyCollection from "../pages/myCollection/myCollection.jsx";

//
const SearchLazy = Loadable({
  loader: () => import("../store/container/searchContainer"),//
  loading: () => Loading,
})

// 
const routes = [
  {path: "/", text: "search", component: SearchLazy}, //
  //{path: "/", text: "search", component: Search },
  {path: "/couponDetail", text: "couponDetail", component: CouponDetail},
  {path: "/search", text: "search", component: Search },
  {path: "/shopDetail", text: "shopDetail", component: ShopDetail},
  {path: "/demo", text: "demo", component: Demo},
  {path: "/allShopList", text: "allShopList", component: AllShopList},
  {path: "/brandDetail", text: "brandDetail", component: BrandDetail},
  {path: "/myCollection", text: "myCollection", component: MyCollection}
];


//@formatter:off
const AppRouter = () => (
  <HashRouter>
    <App>
      {
        routes.map((page, index) => page.component ?
          <Route key={index} exact path={page.path} component={page.component}/> : "")
      }
    </App>
  </HashRouter>
);
//@formatter:on

export default AppRouter;
Mar.16,2021

you import once, Loadable once, of course, it is invalid, because it has long been packaged by webpack


  1. what is your expected effect?
  2. what is the current effect?

according to the official documentation, its dynamic loading is component-based, and if you use webpack, it has route-based dynamic loading itself. And you put it on routing, which is obviously based on route dynamic loading, you can try to put it on a lower layer.


has the landlord solved it? this is also the case when I use react-router4. The page loads normally but does not unpack

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3c70d-2b678.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3c70d-2b678.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?