next-react-server-components icon indicating copy to clipboard operation
next-react-server-components copied to clipboard

Is `next export` supported?

Open adammockor opened this issue 2 years ago • 3 comments

I tried to add next export to package.json like so "build": "yarn next build && yarn next export", but non of the pages (other then 404) is generated. Why so? Not even when I add getStaticProps to some pages, like index.js, csr.js or rsc.server.js.

adammockor avatar Oct 26 '21 17:10 adammockor

Currently, next export is not supported with RSC. You probably don't need RSC if you want all your content to be fully static.

shuding avatar Oct 26 '21 18:10 shuding

Well, not all content should be static. That's the point of RSC if I understand it correctly. If we forget about streaming, colocation of data instead of having getStaticProps and less code in bundle due exclusion of server components and partial hydratation could be very useful for SSG too. But maybe I don't understand it correctly and RSC is not there yet.

adammockor avatar Oct 26 '21 19:10 adammockor

If I understand correctly how next export works, all prerendered HTML will still be hydrated on the client. I‘d love to remove this unnecessary hydration step for static components, which make up most of my pages, and hope that RSC can become a way to make that work.

hippotastic avatar Oct 27 '21 11:10 hippotastic

Hey all! next export support is planned for the app directory, but is not implemented. We won't be adding next export to this demo specifically, but will be talking more about this once support has landed. You can view the roadmap here: https://beta.nextjs.org/docs/app-directory-roadmap

leerob avatar Nov 13 '22 17:11 leerob