Skip to main content

调试渲染失败

由于 JavaScript 代码正在执行,渲染可能会因为异常而发生。以下是解决此问题的一般技巧。

🌐 Since JavaScript code is executing, it may happen that a render may due to an exception. Here are general tips to troubleshoot the issue.

1
启用详细日志记录

通过启用更详细的日志记录,你代码中的所有 console.log 语句将与其他调试信息一起可见。

🌐 By enabling more detailed logging, all console.log statements from your code will be made visible alongside other debugging information.

从 CLI:在你的渲染命令中添加 --log=verbose 标志。 从 Node.JS:向 renderMedia() 添加 verbose: true 选项。

🌐 From the CLI: Add the --log=verbose flag to your render command.
From Node.JS: Add the verbose: true options to renderMedia().

note

如果你多次看到同一条日志,这是因为渲染被拆分到多个线程。暂时设置 --concurrency=1 可以让每条日志只显示一次。

2
向你的项目添加日志

在你的代码中使用 console.log 来了解事情执行的顺序,并验证你对代码应如何运行的假设。

🌐 Use console.log in your code to understand the order things are executing in and verify your assumptions about how your code should behave.

3
逐一移除组件

移除组件直到视频为空。错误在什么时候消失?这可以帮助你识别导致渲染失败的组件。

🌐 Remove components until the video is empty. At which point does the error disappear? This can help you identify the component responsible for the render failure.

4
搜索问题和文档

查看 GitHub 上的问题 也很有帮助,以了解其他人是否遇到过类似的问题。如果你发现一个与你的问题相符的问题,可以在该问题下添加评论,以帮助社区解决问题。

🌐 It's also helpful to check for issues on GitHub to see if other people have encountered similar problems. If you find an issue that matches your problem, you can add a comment to the issue to help the community troubleshoot the problem.

也可以查阅文档,该文档有300多页,包含许多常见问题的故障排除说明。

🌐 Also search the documentation which has over 300 pages and contains troubleshooting instructions for many common problems.

5
寻求帮助

你可以在 GitHub 和 Discord 上寻求帮助。继续阅读以了解如何获取帮助

🌐 You can ask for help on GitHub and Discord. Read on to see how to get help!

另请参阅

🌐 See also