最近不是在鼓捣站定新的皮肤啥的,然后发现评论系统Waline需要升级🆙,跟往常一样在Vercel点击下重新部署就行~但…
不出意外的话,这里果然出了意外:
Error [ERR_REQUIRE_ESM]: require() of ES Module /var/task/node_modules/@mdit/plugin-katex/dist/index.js from /var/task/node_modules/@waline/vercel/src/service/markdown/index.js not supported.
Instead change the require of /var/task/node_modules/@mdit/plugin-katex/dist/index.js in /var/task/node_modules/@waline/vercel/src/service/markdown/index.js to a dynamic import() which is available in all CommonJS modules.
at /opt/rust/nodejs.js:2:14220
at Function.Gn (/opt/rust/nodejs.js:2:14598)
at e.<computed>.st._load (/opt/rust/nodejs.js:2:14190)
at s (/opt/rust/bytecode.js:2:1110) {
code: 'ERR_REQUIRE_ESM'
}
Node.js process exited with exit status: 1. The logs above can help with debugging the issue.
然后就开始查询资料、问AI,最终还是在github仓库找到了解决方法:[Bug]: @waline/vercel 1.41.2 及以上版本在 Vercel 部署时出现 ERR_REQUIRE_ESM 错误 ↗ 这位同学记录了完整错误❌过程。
问题是:
@mdit/plugin-katex 这个依赖包已经转换为 ES Module 格式,但 Waline 的服务端代码仍使用 CommonJS 的 require() 方式加载它,导致 Node.js 无法识别。
下面是解决方案:
扫码分享
文章标题:Vercel更新Waline(1.41.3)失败问题
侵权提示:部分信息可能来源于网络。如发现有侵权,请随时联系删除!












