Separate server and statically generated client in Nextjs app dir
Unanswered
Artrix posted this in #help-forum
ArtrixOP
So, I have an app that I would like to work as an installable app, and a website without having to rewrite any code. I'm planning on using tauri for this. I've done some research and apparently you can set the output type as
The problem is, I'm using the t3 stack (trpc included). Meaning theres some content that is server side rendered. Is it possible to make the app completely client side rendered, without totally rewriting my nextjs app while creating a static page that can be ran standalone on tauri, and whenever it needs to get some type of dynamic data it can fetch it from the server just like the website would. Is this possible please let me know
export /* eslint-disable @typescript-eslint/ban-ts-comment */
// @ts-nocheck
/**
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
* for Docker builds.
*/
await import('./src/env.mjs');
/** @type {import("next").NextConfig} */
const config = {
output: process.env.OUTPUT_TYPE,
transpilePackages: ['ui', 'editor'],
modularizeImports: {},
typescript: { ignoreBuildErrors: true },
};
export default config;The problem is, I'm using the t3 stack (trpc included). Meaning theres some content that is server side rendered. Is it possible to make the app completely client side rendered, without totally rewriting my nextjs app while creating a static page that can be ran standalone on tauri, and whenever it needs to get some type of dynamic data it can fetch it from the server just like the website would. Is this possible please let me know
2 Replies
ArtrixOP
For example, if i were to run a server action/trpc call. It should go to example.com/api/myaction and run it
while the normal website would just go to /api/myaction