Comments (5)
重新试了一下,这次是把 plugins 内的 plugin-qiankun/examples 直接copy 出来,然后单独的 yarn,再yarn start,4个项目都跑起来,但是在chrome 上访问 8000 时,也是一样的问题。
奇怪的是,在 plugin 项目内,yarn 完,然后 build 了,再到 plugin-qiankun/examples 内 yarn start,examples 是跑得很正常的。
在examples内的唯一改动是 .umirc.js
内的 plugins 都换成 ['@umijs/plugin-dva', '@umijs/plugin-antd', '@umijs/plugin-qiankun']
export default {
publicPath: '/app3/',
outputPath: './dist/app3',
mountElementId: 'app3',
qiankun: {
slave: {},
},
plugins: ['@umijs/plugin-dva', '@umijs/plugin-antd', '@umijs/plugin-qiankun'],
// TODO 测试约定式路由
routes: [
{ path: '/', exact: true, component: './index.js' },
{ path: '/:abc', component: './$abc.js' },
{ path: '/users', component: './user/index.js' },
],
// TODO 测试 dynamicImport
// dynamicImport: true,
};
plugin-qiankun
是使用 yarn add @umijs/plugin-qiankun@next --dev
来安装的。package.json
内为 "@umijs/plugin-qiankun": "^2.2.0-0"
from plugins.
下载了 umi 的源码 最终找到了 applyPlugins 的源码,在umi的项目packages/runtime/src/Plugin 的test中,对于参数为 async: true
得测试也是需要await 来调用。
然后把这里 改成
async function getMasterRuntime() {
const config = await plugin.applyPlugins({
key: 'qiankun',
type: ApplyPluginsType.modify,
initialValue: {},
async: true,
});
const { master } = config;
return master || config;
}
重新build 了一次,把生成的lib 复制到 项目的 node_modules
对应的文件夹后,就OK了( ̄▽ ̄)
from plugins.
下载了 umi 的源码 最终找到了 applyPlugins 的源码,在umi的项目packages/runtime/src/Plugin 的test中,对于参数为 async: true
得测试也是需要await 来调用。
然后把这里 改成
async function getMasterRuntime() {
const config = await plugin.applyPlugins({
key: 'qiankun',
type: ApplyPluginsType.modify,
initialValue: {},
async: true,
});
const { master } = config;
return master || config;
}
重新build 了一次,把生成的lib 复制到 项目的 node_modules
对应的文件夹后,就OK了( ̄▽ ̄)
from plugins.
同样遇到这个问题.
请问这个版本的源码 "@umijs/plugin-qiankun": "^2.2.0-0"
怎么看. 没有相应的tag. master分支的代码也对不上.
有条件的话提个pr修复了吧.
from plugins.
使用 ^2.3.0-6 或者重新 npm i @umijs/plugin-qiankun@next
from plugins.
Related Issues (20)
- umi-qiankun peerDependencies react16
- 约定式路由,如何配置 antdpro中的layout属性
- Unable to customize sider in RunTimeLayoutConfig layout
- vue 启用 qiankun插件报错 HOT 1
- 主应用跳转到子应用时,出现空白页
- Uncaught Error: single-spa minified message #13
- 建议plugin-qiankun和qiankun保持同步,怎加自定义fetch请求 HOT 1
- @umijs/plugin-openapi 插件umi4报错api.addMiddewares is not a function
- 主应用路由是 hash 模式的话,子应用使用 history 模式是不是无法接入?
- 由于本项目的依赖有点旧,让项目安装依赖的时候出现少量 deprecated
- 希望@umijs/plugin-openapi增加serversPath参数
- 使用@ant-design/pro-* 编译了超多的var变量 HOT 1
- 升级 react 18, qiankun 报错Unhandled Rejection (TypeError): m.createRoot is not a function
- useModel 不能在ReactDom.render 内使用
- openapi 配置中 customFunctionName 和 customClassName 该如何使用
- 二级菜单可以设置默认展开么,没有找到相关配置
- antd pro 项目使用@umijs/plugin-qiankun改造成微前端,如何在主应用的二级菜单中指向子应用的某个非首页路由呢?
- antd pro 4.0.0 在哪里添加qiankun lifecycle函数呢?
- 使用initial-state等插件报错
- layout插件中,如何使用onCollapse
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plugins.