• Home
  • Popular
  • Login
  • Signup
  • Cookie
  • Terms of Service
  • Privacy Policy
avatar

Posted by Mark DS


08 Jan, 2025

Updated at 20 Jan, 2025

在 Vue Render 中,对于异步组件,当 async setup 中出现异常时,renderToString 无法捕获到异常

我的是 SSR 项目,这边排查到是因为异常被吞掉了,对应的源码地址为:https://github.com/vuejs/core/blob/main/packages/server-renderer/src/render.ts#L107-L118

提示截图

image

请问一下,这里为什么要用 NOOP,不直接抛出异常呀?

https://codesandbox.io/p/devbox/heuristic-jennings-z8y2kg
这里有一个客服端渲染的 demo,问题都存在,可以快速复现一下

感谢🙏