gpt4 book ai didi

next.js - 如果包含 [id].js 页面,如何在 Google 托管上部署 NEXTJS 应用程序?

转载 作者:行者123 更新时间:2023-12-03 20:48:29 26 4
gpt4 key购买 nike

我有一个使用 Google 托管的应用程序。在实现动态路由之前,我通过执行 next export 来托管它。和 firebase deploy .
在我的 [id].js文件我使用 getServerSideProps 获取数据并在执行 next export 时我有下一个错误:

pages with getServerSideProps can not be exported Read More.


解决方案是“从 package.json 中删除 next export”。但是如何在没有 next export 的情况下托管我的应用程序?

最佳答案

为什么不在 vercel 上托管您的应用程序?它让一切变得如此简单。如果你真的想在谷歌上托管它,用 getStaticProps 或客户端渲染替换 getServerSideProps

关于next.js - 如果包含 [id].js 页面,如何在 Google 托管上部署 NEXTJS 应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64296678/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com