Navbar links rise a problem
boulaffasae opened this issue · 2 comments
boulaffasae commented
When user is not on Homepage /
, a problem occur in the navbar links. All links link to a misplaced file.
- Navigate to the New arrivals page
- Now click on another navbar link, such as Sofas
- A 404 page is showen,
/new-arrivals/sofas
Not Found
Why the problem occur ?
In the following JavaScript code,
<Link to={l.link} key={i}>
link
values are missing a /
prefix. And it render as:
<a href="sofas>
How can we resolve the issue ?
Prefix all links with a /
.
<Link to={`/${l.link}`} key={i}>
francispham commented
@boulaffasae I got the same problem as well. I tried but your resolve doesn't work. I found the links work fine when you don't upgrade the package.json and yarn.lock files!
boulaffasae commented
Then this might be because of this PR feat(gatsby): Add support for relative links #24054