【发布时间】:2021-09-30 13:04:26
【问题描述】:
我正在使用 Gatsby 制作应用程序,但出现此错误:
SSRing 路径时出现意外错误:/ ReferenceError: 未定义窗口。
const activeIndex = () => {
const found = routes.indexOf(
routes.filter(
({ node: { name, link } }) =>
(link || `/${name.toLowerCase()}`) === window.location.pathname
)[0]
)
return found === -1 ? false : found
}
错误来自这些代码。谢谢
【问题讨论】: