spa5k / nextjs_approuter_electron

This is a template for building Electron apps with Next.js App router, SSR and Server Components
https://www.saybackend.com/blog/03-electron-nextjs-ssr
58 stars 8 forks source link

next-server showing in menu bar #3

Closed dnnsjsk closed 3 months ago

dnnsjsk commented 3 months ago

PixelSnap 2024-07-15 at 15 32 46@2x

I can't seem to fix this! It seems like the productName is being overwritten by the Next server.

spa5k commented 3 months ago

Not sure, you will probably need to custom hack it or something

spa5k commented 3 months ago

You can override it using the Next.js utilities, or normal head tag, title tag

https://nextjs.org/docs/app/building-your-application/optimizing/metadata

import type { Metadata } from 'next'

export const metadata: Metadata = {
  title: '...',
  description: '...',
}

export default function Page() {}

Report again if this does not fix it.

dnnsjsk commented 3 months ago

Had to set it manually after starting the server:

await startServer({
        dir: webDir,
        isDev: false,
        hostname: "localhost",
        port: nextJSPort,
        customServer: true,
        allowRetry: false,
      });
      process.title = "OneClick Pro";