rsnext/errors/gssp-export.md
Rich Haines 138361208c
Fixed duplicate data fetching overview page + links (#33774)
This PR removes the duplicate overview link for data fetching, and fixes the corresponding links

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`


Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-01-29 02:52:40 +00:00

1.4 KiB

getServerSideProps Export Error

Why This Error Occurred

You attempted to statically export your application via next export, however, one or more of your pages uses getServerSideProps.

The getServerSideProps lifecycle is not compatible with next export, so you'll need to use next start or a serverless deployment.

Possible Ways to Fix It

  1. If you'd like to keep your application static, you can use getStaticProps instead of getServerSideProps.

  2. If you want to use server-side rendering, update your build command and remove next export. For example, in your package.json:

    diff --git a/bla.json b/bla.json
    index b84aa66c4..149e67565 100644
    --- a/bla.json
    +++ b/bla.json
    @@ -1,7 +1,7 @@
    {
      "scripts": {
        "dev": "next dev",
    -    "build": "next build && next export",
    +    "build": "next build",
        "start": "next start"
      }
    }
    

Note

: Removing next export does not mean your entire application is no longer static. Pages that use getStaticProps or no lifecycle will still be static!