在 "next": "^13.2.4"
上运行 next build
不会在 ".next" 中生成 "export" 文件夹。
next.config.js
中设置了 output: 'export'
在 Canary 版本上运行 next build
会生成 "export" 文件夹,但是会出现大量错误 SyntaxError: Unexpected token u in JSON at position 0
。在整个项目中没有使用 JSON 或 parse
。
使用 App 文件夹结构。
编辑
next export
已被弃用,建议使用 output: 'export'
。运行它会抛出错误:"PageNotFoundError: Cannot find module for page:"
任何版本的想法都将不胜感激。
编辑2
问题似乎在命令 "use client"
中,删除该命令可能会在某些情况下解决该问题。此外,最新的 canary 发布 版本中 NextJS 显然已经修复了这个问题,但您的体验可能会有所不同。