Next.js Discord

Discord Forum

<Link> doesn't work on builded app in not-found.ts

Unanswered
Siamese posted this in #help-forum
Open in Discord
SiameseOP
Hi, it changes the url but the screen itself doesn't change. On dev enviroment it works fine

6 Replies

SiameseOP
my code:
import styles from '@/src/styles/main.module.css';
import Link from 'next/link';

export default function NotFound() {
    return (
        <>
            <style>{`body {overflow: hidden} main {height: 100%; width: 100%; position: absolute;}`}</style>
            <div className={styles.containerWrapper}>
                <div className={styles.notFoundContainer}>
                    <h1>404</h1>
                    <h2>We couldn't find this page</h2>
                    <h3>Please check the spelling of the link you want to go for and refresh the site</h3>
                    <Link href={"/"}>Go Home</Link>
                </div>
            </div>
        </>
    )
}
this is a next bug but it should be fixed for months already. what's your nextjs version?
14.1.0
Imma update to 14.1.4
react-dom 18.2.0
react 18.2.0