У меня есть веб -сайт Next.js с приложением/ папкой как So:
│ favicon.ico
│
├───(main)
│ │ layout.js
│ │ layout.module.css
│ │ not-found.js
│ │ page.js
│ │ page.module.css
│ │
│ └───ImageModal
│ ImageModal.js
│ ImageModal.module.css
│
├───dashboard
│ │ layout.js
│ │ page.js
│ │
│ ├───download
│ │ layout.js
│ │ page.js
│ │
│ └───settings
│ page.js
│
└───rendertune
layout.js
not-found.js
page.js
Я хочу, чтобы мой (Main) маршрут имел свою собственную страницу 404, которая поставляется в файле Mayout.js, в то время как в маршруте rendertune/ есть собственная страница 404 444, если я посещаю страницу 404 на корневом маршруте. http: // localhost: 3000/thisrouteDeSntexist я вижу (main)/not-found.js внутри (main) /layout.js
и если я посещаю http: // localhost: 3000/rendertune/thisroutedeesnextextxistntexntexntexntexntexntexntexntexntexntexntext. rendertune/not-found.js внутри rendertune/layout.js
Но если я посещаю либо 404 страницы, все они появляются в виде по умолчанию 404, а мои пользовательские файлы не Find.js не появляются:
my (main) \ not-found.js выглядит так:
import Link from 'next/link'
export default function NotFound() {
return (
(main) 404
Return Home
)
}
и мой rendertune/not-found.js выглядит так:
export default function RenderTuneNotFound() {
return (
404 – RenderTune
);
}
Подробнее здесь: https://stackoverflow.com/questions/796 ... ot-working