#your issue was that the dynamic route

1 messages · Page 1 of 1 (latest)

golden cairn
#

So, here in the thread

#

This is the license table. Each item do this urls as example:

#
http://localhost:3000/licenses/detail/0BSD
http://localhost:3000/licenses/detail/AFL-1.1
#

First one, works perfectly

#

Second one, failt with 404

clear fiber
#

i think the best thing to do is just do a replaceAll to make non letters/numbers/- turns into - ...

golden cairn
#

i though in using the id, only numbers then, but before i needed to ask if there were some solution

clear fiber
#

wait, can you log the prop "id" and see if it is doing some weird encoding

golden cairn
#

The think is that we never reach the page. is a direct 4.0.4

clear fiber
#

ohh i forgot about that...

golden cairn
#

Just to say, i'm using this old way because the original site was done this way, we are porting to next.js from liferay to make our life less hellish

#

But i can do with id's, no problem

#

Thanks anyway

clear fiber
#

well, i just tested and i can get the page to work

#

can you share your [id]/page.tsx/jsx file

golden cairn
#

Of course

#
'use client'

import React, { useEffect, useState, useCallback } from 'react'
import { usePathname } from 'next/navigation'

function LicenseDetail() {
    const pathname = usePathname()

    return <div>License Detail: {pathname}</div>
}

export default LicenseDetail
#

Is a test to check if works

clear fiber
#

ahh so your using usePathname not the actual method of dynamic routes

#

(but i don't see how that would break it)

golden cairn
#

As you can see, the only thing is done is:
<Link href={`licenses/detail/${item._links.self.href.split('/').pop()}`} >{item._links.self.href.split('/').pop()}</Link>

clear fiber
golden cairn
#

You used app router or page router ?

clear fiber
#

app router

golden cairn
#

So must be something on our configuration

clear fiber
#

😭

golden cairn
#

@clear fiber Thanks anyway, i will close the thread

clear fiber
#

btw you can now remove "experimental.appDir"

golden cairn
#

Oh yes, good catch

clear fiber
golden cairn
#

Did, not helped. I will investigate better

#

Anyway, i sent a PR to update the version and config changes. You're time was not waster. Thanks @clear fiber

#

Should i close this thread ?

clear fiber
#

your choice

golden cairn
#

Ok