Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ant-design-pro v6 使用 qiankun 在开发环境能正常使用,build 后 主应用 加载 子应用会报 initFocus is not a function 错误 #938

Open
yanthink opened this issue May 10, 2023 · 1 comment

Comments

@yanthink
Copy link

image

主应用和子应用都使用 ant-design-pro 6.0.0 开发, dev 环境能正常使用,build 后 主应用 加载 子应用会报 initFocus is not a function 错误

主应用配置

config/config.ts

qiankun: {
   master: {},
},

src/app.tsx

export const qiankun = {
  apps: [
    {
      name: 'app1',
      entry: '//localhost:8888',
    },
  ],
  routes: [
    {
      path: '/app1/*',
      name: 'app1',
      microApp: 'app1',
      microAppProps: {
        autoCaptureError: true,
      },
    },
  ],
};

子应用配置

config/config.ts

qiankun: {
    slave: {
      shouldNotModifyDefaultBase: true,
    },
 },

src/app.tsx

export const qiankun = {
  bootstrap() {
    console.log('react app bootstraped');
  },
  mount(props) {
    console.log(props);
  },
  unmount(props) {
    console.log(props);
  },
  update(props) {
    console.log(props);
  },
};

OS: MacOS 13.0 (22A380)

Node:v19.7.0

浏览器 | browser:Chrome 113.0.5672.92

@yanthink
Copy link
Author

umi 配置加上 esbuildMinifyIIFE: true 就好了,建议官方在 umijs 微前端文档FAQ里加上,不然对新手太不友好了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant