Skip to content

Error for page /sitemap.xml: pages with getServerSideProps #14

@mohammadne

Description

@mohammadne

Hi, first of all, thank you for your fantastic website.

I want to deploy your project via GitHub-actions but it throws an error:

 Error occurred prerendering page "/sitemap.xml". Read more: https://nextjs.org/docs/messages/prerender-error
Error: Error for page /sitemap.xml: pages with `getServerSideProps` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export
    at /home/runner/work/mohammadne.github.io/mohammadne.github.io/node_modules/next/dist/export/worker.js:254:23
    at async Span.traceAsyncFn (/home/runner/work/mohammadne.github.io/mohammadne.github.io/node_modules/next/dist/trace/trace.js:79:20)
info  - Exporting (7/7)
Error: Export encountered errors on following paths:
	/sitemap.xml
    at /home/runner/work/mohammadne.github.io/mohammadne.github.io/node_modules/next/dist/export/index.js:415:19
    at async Span.traceAsyncFn (/home/runner/work/mohammadne.github.io/mohammadne.github.io/node_modules/next/dist/trace/trace.js:79:20)
Error: Process completed with exit code 1.

it says that we should use getStaticProps instead of getServerSideProps, as I'm a backend developer and I'm not very deep in nextjs, I wonder to know that is it possible to do that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions