Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navbar links rise a problem #16

Closed
boulaffasae opened this issue Oct 6, 2020 · 2 comments
Closed

Navbar links rise a problem #16

boulaffasae opened this issue Oct 6, 2020 · 2 comments

Comments

@boulaffasae
Copy link

When user is not on Homepage /, a problem occur in the navbar links. All links link to a misplaced file.

  1. Navigate to the New arrivals page
  2. Now click on another navbar link, such as Sofas
  3. 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
Copy link

@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
Copy link
Author

Then this might be because of this PR feat(gatsby): Add support for relative links #24054

@dabit3 dabit3 closed this as completed Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants