Next.js Discord

Discord Forum

App router without server? Is it possible?

Answered
Black Caiman posted this in #help-forum
Open in Discord
Black CaimanOP
I understand that, by default, all components inside app are Server Components, and that they can be turned into Client Components by specifying use client at the top. But does this still mean that a server is required to use the App router, even if all of my components/pages have use client? Or could I still for example use Next.js in "SPA-mode" with output: "export" alongside the App router?
Answered by joulev
with output export, you don't need a running server yes
View full answer

4 Replies

Answer
that, of course, requires you to make all pages static (so all server components can be built at build time)
Black CaimanOP
Gotcha, thanks. I'm trying to use Next.js in a way that I have the option to add SSR later down the line, but prefer running it as an SPA until I am ready to get into SSR. Seems like that is still possible then without having to use the old (soon deprecated?) Pages Router. Thanks!