#router redirection not working??

60 messages · Page 1 of 1 (latest)

upper fossil
#

Hello !

My router dosnt redirect to /board/${data.id} as intended on my form-popover file. It should show me a 404page cause i didnt created the page for now witch is normal. Ive tried alot of things to debug but i could not find the solution for several days now. I tried console logging the link, and when its pasted it shows that404 page . I also tried downgrading the version of next but dosnt changed. I am realy lost there.

my repo : https://github.com/SHOOTSTV/trello-clone

my prisma schema aswel :

generator client {
provider = "prisma-client-js"
}

datasource db {
provider = "mysql"
url = env("DATABASE_URL")
relationMode = "prisma"
}

model Board {
id String @id @default(uuid())
orgId String
title String
imageId String
imageThumbUrl String @db.Text
imageFullUrl String @db.Text
imageUserName String @db.Text
imageLinkHtml String @db.Text

createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}

GitHub

Contribute to SHOOTSTV/trello-clone development by creating an account on GitHub.

solar stoneBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

upper fossil
#

. /components/form/form-popover.tsx

flint oak
#

i checked everywhere

#

there is no route /board

#

@upper fossil

upper fossil
flint oak
#

okayy um so what doesn't work?

upper fossil
#

I didnt pushed the version that I did created the route but it does nothing at all

#

Even if I created it

upper fossil
#

Like its Frozen or something

flint oak
#

can you send like the latest code..

upper fossil
#

Yes I will do it soon as im back home 🙏, thank you for your Time

flint oak
#

I see, safe driving. It would be nice next time if you can send a proper context if you want to ask help 🙏

upper fossil
#

Yes I understand. I am sort of new to coding so I dont have the proper wording sometimes

#

Sorry for that, i struggle to write What the problem actualy is

flint oak
#

I see, then we will look at it together and which part doesn't work

upper fossil
#

🙏 thanks alot

midnight thorn
#

there is no app/not-found.tsx page is created, thats why 404 or page not found is coming , first you have to create this file then this file will handle all the routes which are not present and show 404 or any thing which you erite in this file

cloud egret
#

try this

router.refresh()
router.push(`/board/${data.id}`);
upper fossil
cloud egret
#

cause i had same issues in the past and this always fixed it for me

midnight thorn
#

You need to create not-found.tsx file in app folder

upper fossil
#

(still no redirection)

upper fossil
upper fossil
cloud egret
#

no redirection?

upper fossil
#

no :/

cloud egret
#

and your toast triggers?

#

and whatever that is closes?

upper fossil
#

thats weird cause when i hover the board i can see this on the bottom left corner

#

but clicking dosnt do anything

upper fossil
cloud egret
#

extremely weird

#

it doesnt redirect

#

even with refreshing the router cache

#

it should tho so idk

upper fossil
#

looks like it auto redirects me on the last page

#

we can see the url changing from the good one (board/*) to the original org/** page

upper fossil
flint oak
upper fossil
#

Yes I created one

flint oak
#

try removing middleware.ts

#

and redirecting again

upper fossil
#

i just did, it looks like i can access the board page whitout getting rollback like the video I sent

#

but i dont know if its just because the auth is now broken due to the middleware deletion and i can't go into the org page

flint oak
upper fossil
#

I see

#

that's strange because I was following a tutorial, maybe alot changed between my et his next versions?

#

because for example he's using authMiddleware which is deprecated and is now clerkMiddleware