Pages Beta / Next.js

Is it possible to deploy Next.js apps to Pages (beta) ?

At the moment, the only option says Next.js (Stating HTML export). We would like to have some ‘server-side rendering’ for some secure operations (‘getServerSideProps’)

Is that possible? Any good pointers?

On Pages it’s not possible, nor is on the roadmap as it’s based on Workers and that won’t work.

You can do SSR, but at build time.

At build time will not work for this specific case…
There are some pages that for security reasons need to be generated each time in the backend.
Are there any product/services within Cloudflare that would allow this kind of next.js deployment?

Either you put a Worker, using HTMLRewriter which substitutes some value in the Pages SSR generated files (this doesn’t currently work as Workers can’t run on Pages subdomains, there is a bug with the proxy implementation, but it should be fixed pretty soon).

Alternative: you can generate at request time using Workers, but that needs to be done by you or some third-party tool.

Final alternative: you use a different backend and proxy via Cloudflare.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.