#your issue was that the dynamic route
1 messages · Page 1 of 1 (latest)
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
i think the best thing to do is just do a replaceAll to make non letters/numbers/- turns into - ...
i though in using the id, only numbers then, but before i needed to ask if there were some solution
wait, can you log the prop "id" and see if it is doing some weird encoding
The think is that we never reach the page. is a direct 4.0.4
ohh i forgot about that...
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
well, i just tested and i can get the page to work
can you share your [id]/page.tsx/jsx file
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
ahh so your using usePathname not the actual method of dynamic routes
(but i don't see how that would break it)
And the main page:
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>
so, i just tested this myself, and it worked...
You used app router or page router ?
app router
So must be something on our configuration
ðŸ˜
https://github.com/eclipse-sw360/sw360-frontend
( fully OSS app )
@clear fiber Thanks anyway, i will close the thread
btw you can now remove "experimental.appDir"
Oh yes, good catch
and can you also try updating to the latest nextjs version
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 ?
your choice
Ok