Next.js Discord

Discord Forum

next-international ssg rendering link

Unanswered
Spectacled bear posted this in #help-forum
Open in Discord
Spectacled bearOP
i'm using the library [next-international](https://github.com/QuiiBz/next-international) to implement localization to my tauri app that requires ssg rendering. since the app is ssg i cant use middleware and i struggle to route to other pages using the Link component (next/link). whenever i click the link component i get the error in the attatched photo.

3 Replies

Spectacled bearOP
im unsure if this is the right place but there is no discord server for the package,

this is my project structure
Spectacled bearOP
i tried creating a custom Link component

import NextLink from "next/link";
import type { ComponentProps } from "react";
import { getCurrentLocale } from "./server";

export default function Link({
  href,
  children,
  ...rest
}: Readonly<{ href: string; className?: string; children: React.ReactNode }> &
  ComponentProps<typeof NextLink>) {
  const locale = getCurrentLocale();

  return (
    <NextLink href={`/${locale}${href}`} locale={locale} {...rest}>
      {children}
    </NextLink>
  );
}
but when pressed it just refreshes the page