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

Cannot read property 'asyncComponentsAncestor' of undefined #1256

Closed
MinJieLiu opened this issue Sep 27, 2017 · 9 comments
Closed

Cannot read property 'asyncComponentsAncestor' of undefined #1256

MinJieLiu opened this issue Sep 27, 2017 · 9 comments
Labels

Comments

@MinJieLiu
Copy link

  • 环境:dva@2
  • 触发条件:升级到 React 16.0.0

报错:

Warning: Failed child context type: Cannot read property 'asyncComponentsAncestor' of undefined
    in AsyncComponent (created by Route)
    in section (created by CoreLayout)
    in CoreLayout (created by Route)
    in Route
    in Switch
    in Router
    in Provider
    in Unknown
@MinJieLiu
Copy link
Author

@sorrycc sorrycc added the bug label Sep 27, 2017
@sorrycc
Copy link
Member

sorrycc commented Sep 27, 2017

考虑把 react-async-component 给换了,用 https://github.com/faceyspacey/react-universal-component 或者自己实现吧。

@sorrycc
Copy link
Member

sorrycc commented Sep 29, 2017

试着升级 example 的 react 到 16,发现这个问题应该和升级 react@16 无关。9539663

@chunsch
Copy link

chunsch commented Sep 29, 2017

@sorrycc dva-example 路由没有异步加载,所以不会出现该错误。而 dva-example-user-dashboard 路由使用了异步加载,升级到 react 16,则会出现该错误。

@caigehui
Copy link

使用到dynamic就会出现这个问题

@idowe
Copy link

idowe commented Oct 3, 2017

使用了()=>还是会报错,不知道为什么

@rtorino
Copy link

rtorino commented Oct 9, 2017

v2.0.3 does not include this fix. I'm waiting for this to be release on NPM. Thanks.

@caigehui
Copy link

+1

@MinJieLiu
Copy link
Author

MinJieLiu commented Oct 13, 2017

react-async-component 已经修复了此问题
ctrlplusb/react-async-component@ccf7672

sorrycc added a commit that referenced this issue Oct 19, 2017
yibuyisheng pushed a commit to yibuyisheng/dva that referenced this issue Oct 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants