Skip to content

Commit ee760f7

Browse files
committed
fix: 404 page build error
1 parent c8272a0 commit ee760f7

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ If you prefer Tailwind css, check this: [Tailwind-CSS-Version](https://github.co
2323
- Clone & install React19-Next15-MUI6-TS-Starter:
2424
- `git clone -b react19-nextjs15 https://github.com/AlexStack/nextjs-materia-mui-typescript-hook-form-scaffold-boilerplate-starter.git react19-nextjs15-mui6-ts-starter && cd react19-nextjs15-mui6-ts-starter && yarn install && yarn dev -p 3005`
2525
- Open <http://localhost:3005>
26-
- Note: React 19 is not released yet, this are some warnings in the console, please ignore them.
26+
- Note: React 19 is not released yet, there are some warnings in the console, please ignore them.
2727
- Clone & install React18-Next14-MUI5-TS-Starter:
2828
- `git clone -b nextjs14 https://github.com/AlexStack/nextjs-materia-mui-typescript-hook-form-scaffold-boilerplate-starter.git react18-nextjs14-mui5-ts-starter && cd react18-nextjs14-mui5-ts-starter && yarn install && yarn dev -p 3005`
2929
- Open <http://localhost:3005>

src/app/not-found.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import { Box } from '@mui/material';
55
import { Metadata } from 'next';
6+
import { usePathname } from 'next/navigation';
67
import * as React from 'react';
78
import { RiAlarmWarningFill } from 'react-icons/ri';
89

@@ -11,6 +12,7 @@ export const metadata: Metadata = {
1112
};
1213

1314
export default function NotFound() {
15+
const pathname = usePathname();
1416
return (
1517
<main>
1618
<Box sx={{ textAlign: 'center' }}>
@@ -20,7 +22,8 @@ export default function NotFound() {
2022
className='drop-shadow-glow animate-flicker text-red-500'
2123
/>
2224
<h1>Page Not Found</h1>
23-
<div>{window.location.href} NOT exists</div>
25+
{/* <div>{window.location.href} NOT exists</div> */}
26+
<div>{pathname} NOT exists</div>
2427
<h5>change this in app/not-found.tsx</h5>
2528
<a href='/'>Back to home</a>
2629
<div>

0 commit comments

Comments
 (0)