Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问如何将此应用编译成静态网页,使用客户端渲染? #77

Open
CliffHan opened this issue Jun 13, 2024 · 0 comments
Open

Comments

@CliffHan
Copy link

我想要将此应用编译成一个静态的网页,去掉其原有的 api,使用自己的后端 api 替代。

这样前端就无需发送 app_id 和 api_key,这些信息保存在自己的后端服务器,根据后端设置决定是否允许前端请求。

但如果我在 next.config.js 中加上 output: 'export' 后,npx run build 报错:

Build error occurred
Error: Page "/api/conversations/[conversationId]/name" is missing "generateStaticParams()" so it cannot be used with "output: export" config.

去掉 app/api 目录后,编译还是报错:
Generating static pages (0/4) [== ]a [Error]: Page with dynamic = "error" couldn't be rendered statically because it used cookies.

能否指导一下这个需求如何实现?谢谢。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant