alibaba / ice

🚀 ice.js: The Progressive App Framework Based On React(基于 React 的渐进式应用框架)

Home Page:https://ice.work

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

浏览器引用懒加载资源报错问题请教

Sharang-heng opened this issue · comments

Describe the bug

懒加载引入组件
const MapDetail = lazy(() => import(/* webpackChunkName: 'MapDetail' *//webpackPrefetch: true/'@/pages/DataMap/components/Detail/Detail'));

const MetaInfoConfig = lazy(
() => import(/* webpackChunkName: 'MetaInfoConfig' */ '@/pages/MetaDataManage/component/MetaDataConfig'),
);
部署项目到浏览器之后,能正常运行,但是偶尔浏览器会报加载不了资源的错误
image
image
image

Expected behavior

这个应用是主应用,子应用同样也有懒加载,不确定这样会不会有影响,想请教一下要如何处理这种情况

Actual behavior

No response

Version of ice.js

2.6.6

Content of build.json or ice.config.mts

const version = require('./package.json');
const path = require('path');

module.exports = {
  outputDir: `dist@v${version.version.replace(/\./g, '_')}`,
  hash: true,
  proxy: {
  },

  plugins: [
    'configplugin',
    [
      'build-plugin-ignore-style',
      {
        libraryName: 'antd',
      },
    ],
    ['build-plugin-keep-alive'],
    ['build-plugin-jsx-plus'],
    [
      'build-plugin-antd',
      {
        disableModularImport: true,
        themeConfig: {
          'primary-color': '#0069ff',
          'link-color': '#0069ff',
          'success-color': '#389e0d',
          'warning-color': '#fe823e',
          'error-color': '#fe3e3e',
          'border-color-base': '#e4e7ed',
          'border-radius-base': '4px',
        },
      },
    ],
  ],
};

Additional context

No response

关注异步资源加载的地址,如果是调试过程发生,可以参考文档