【发布时间】:2022-12-22 06:20:00
【问题描述】:
我们使用 next.js 和 knex.js 作为查询生成器,在所有页面中一切正常,除了在我们有 ISR aka getStaticPaths 的页面中,并且在该方法中,每当我们尝试执行查询时,我们都会收到以下错误,但在其他没有getStaticPaths的页面一切正常:
Server Error
Error: getaddrinfo ENOTFOUND undefined
This error happened while generating the page. Any console logs will be displayed in the terminal window.
Call Stack
GetAddrInfoReqWrap.onlookup [as oncomplete]
node:dns (71:26)
其他任何地方都没有提供更多信息。正如错误消息中所示,数据库主机未定义,但为什么除了getStaticPaths之外,它在任何地方都可以正确读取??
【问题讨论】: