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

base没有的component,project里如何捕捉异常? #16

Closed
aov2005 opened this issue Nov 20, 2020 · 4 comments
Closed

base没有的component,project里如何捕捉异常? #16

aov2005 opened this issue Nov 20, 2020 · 4 comments

Comments

@aov2005
Copy link
Contributor

aov2005 commented Nov 20, 2020

目前看到的是报错

throw new Error('Module "' + module + '" does not exist in container.');

在bootstrap.js里catch不到

try{
  const Abc = defineAsyncComponent(() => import('vue3Components/abc'))
  app.component('abc-element', Abc)
}catch(err){
  console.log(err)
}
@ckken
Copy link
Contributor

ckken commented Nov 20, 2020

组件加载放到了 外部 webpack://@empvue3/base/webpack/container-entry 可以说说你的业务场景

@aov2005
Copy link
Contributor Author

aov2005 commented Nov 20, 2020

场景是
一个工厂base,多个消费者project,base提供公共依赖,并且可以通过接口动态注册import project,base渲染出所有project组件,如果接口返回了,但是没project,需要显式的报错给访问base的前端用户

@ckken
Copy link
Contributor

ckken commented Nov 20, 2020

......看看可能弄个demo

@aov2005
Copy link
Contributor Author

aov2005 commented Nov 20, 2020

可能方向错了,再研究下吧,看看怎么把project里的组件单独编译出来存数据库里,base拉取的时候动态定义component

@aov2005 aov2005 closed this as completed Nov 20, 2020
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

2 participants