Next.js Discord

Discord Forum

Tauri + Next.js App router with ISR and SSR?

Unanswered
Artrix posted this in #help-forum
Open in Discord
So I was wondering if this stack is possible. I have a app that I want to be installable as a desktop app AND function in the browser (I know PWAs exist but i want the desktop app to actually feel like a desktop app). So far, I've been using electron (index.js is the linked file)

But it has 1 large caveat. Absolutely NO offline support whatsoever.

For my use case, its necessary for the app to at least partially work standalone, it doesn't need API access, just the basic ability to render some components. So I got to thinking, is it possible to keep my entire nextjs app without rewriting or changing any code (with app dir), and have it build a static shell of html and js that can be rendered by tauri/electron (preferably tauri but idc), and build out the page without all the dynamic content that would come from the api later (once it finds an internet connection) but the user should atleast be able to see a basic app without an internet connection.

Any thoughts on if this is possible currently?

4 Replies

bump?
Tauri apps are only cient-side/static generated, as far as I know there is no option for working ISR 🙂
Toyger
keep app without rewriting impossible.
iirc tauri will not give any performance gains unless you'll rewrite some performance critical app parts to rust, without rewriting it will be same as electron.
But even electron have more ready solutions. you can look at something like this https://github.com/vercel/next.js/discussions/28243 and https://github.com/saltyshiomix/nextron