【发布时间】:2021-08-04 07:36:18
【问题描述】:
通过使用 NextJS 文档中的引用在 NextJS 中使用 Rewrites 时出现错误
我尝试重新安装 node_modules 但它仍然无法正常工作
环境变量有效,但重写功能无效
这是我的 next.config.js
module.exports = {
env: {
APPNAME: 'NextJS Exercise!!!',
},
async rewrites() {
return [
{
source: '/login',
destination: '/auth/login',
},
]
},
}
这是我得到的错误
TypeError: (0 , _resolveRewrites.default) 不是函数
【问题讨论】:
-
删除 .next 文件夹并重新运行是否有效?
标签: javascript reactjs webpack babeljs next.js