问题:
Next JS 动态导入在移动设备浏览器上加载时卡住了(使用的浏览器:IOS 上的 Google Chrome 和 Safari。)而它在桌面上的 Google Chrome 和 Mozilla 上运行良好。我也在默认配置上使用 next-PWA。会不会是因为 next-PWA?
代码片段:
import dynamic from "next/dynamic";
import { useMemo } from "react";
export default function Main() {
const Component = useMemo(
() =>
dynamic(() => import("@components/Component"), {
loading: () => <p>The component is loading</p>,
ssr: false,
}),
[],
);
return(<div><Component/></div>);
}
在移动设备上输出
The component is loading
桌面浏览器上的输出
Hello from Component