通过使用 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.config.js Code
The Error
最佳答案
我之前在一个干净的 nextjs 项目中遇到了这个问题。
有一个快速修复:
npm install
再次。 如果以上都不能解决,请尝试将nextjs包升级到
10.2.0
,npm install next@latest
关于javascript - NextJS Rewrites TypeError : (0 , _resolveRewrites.default) 不是函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67529053/