errors/gssp-export.mdx
You attempted to statically export your application via output: 'export' or next export, however, one or more of your pages uses getServerSideProps.
It is not possible to use getServerSideProps without a server, so you'll need to use next start when self hosting or deploy to a provider like Vercel.
If you'd like to keep your application static, you can use getStaticProps instead of getServerSideProps.
If you want to use server-side rendering, update your build command and remove output: 'export' and remove next export. For example, in your package.json:
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"scripts": {
"dev": "next dev",
- "build": "next build && next export",
+ "build": "next build",
"start": "next start"
}
}
--- a/next.config.js
+++ b/next.config.js
@@ -1,4 +1,4 @@
{
module.exports = {
reactStrictMode: true,
- output: "export",
}
}
Note:
- Removing export does not mean your entire application is no longer static.
- Pages that use
getStaticPropsor no lifecycle will still be static!