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

[Bug]: 根据文档操作微前端运行失败 #6113

Open
xmsz-stu opened this issue Aug 22, 2024 · 1 comment
Open

[Bug]: 根据文档操作微前端运行失败 #6113

xmsz-stu opened this issue Aug 22, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@xmsz-stu
Copy link

版本信息

System:
    OS: macOS 14.6.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 23.66 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Browsers:
    Chrome: 127.0.6533.120
    Edge: 97.0.1072.69
    Safari: 17.6
    Safari Technology Preview: 18.0
  npmPackages:
    @modern-js/app-tools: 2.58.2 => 2.58.2 
    @modern-js/eslint-config: 2.58.2 => 2.58.2 
    @modern-js/plugin-garfish: 2.58.2 => 2.58.2 
    @modern-js/runtime: 2.58.2 => 2.58.2 
    @modern-js/tsconfig: 2.58.2 => 2.58.2

问题详情

根据https://modernjs.dev/guides/topic-detail/micro-frontend/c02-development.html文档操作
然后各自应用都能运行,但是在主应用里加载子应用时无法加载,提示

Unexpected Application Error!
Cannot use 'in' operator to search for 'default' in null
TypeError: Cannot use 'in' operator to search for 'default' in null
    at lazyInitializer (http://localhost:8081/static/js/lib-react.js:34647:23)
    at mountLazyComponent (http://localhost:8081/static/js/lib-react.js:19946:19)
    at beginWork (http://localhost:8081/static/js/lib-react.js:21595:16)
    at beginWork$1 (http://localhost:8081/static/js/lib-react.js:27428:14)
    at performUnitOfWork (http://localhost:8081/static/js/lib-react.js:26559:12)
    at workLoopSync (http://localhost:8081/static/js/lib-react.js:26468:5)
    at renderRootSync (http://localhost:8081/static/js/lib-react.js:26436:7)
    at recoverFromConcurrentError (http://localhost:8081/static/js/lib-react.js:25852:20)
    at performConcurrentWorkOnRoot (http://localhost:8081/static/js/lib-react.js:25752:22)
    at workLoop (http://localhost:8081/static/js/lib-react.js:36296:34)

复现链接

https://github.com/xmsz/demo-20240822.git

复现步骤

各个目录pnpm i , pnpm run dev
打开8080
点击跳转到子应用

@xmsz-stu xmsz-stu added the bug Something isn't working label Aug 22, 2024
@caohuilin
Copy link
Member

image
按照复现步骤试了一下,没报错

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants