question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Trailing slash route mismatch

See original GitHub issue

Hey guys, I think this is still an issue. When using trailingSlash: true and basePath: /dev you get warnings on the console like so: Warning: Prop 'href' did not match. Server: "/dev/second" Client: "/dev/second/".

Tried both ways:

<Link href="/second">
  <a>Second Page</a>
</Link>

and

<Link href="/second/">
  <a>Second Page</a>
</Link>

next version 9.4.5-canary.42

@Unsfer @Timer

_Originally posted by @marlonmarcello in https://github.com/vercel/next.js/issues/15194#issuecomment-662167808_

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
awareness481commented, Jul 25, 2020

@awareness481 You are using the exportTrailingSlash and not the trailingSlash option. You’ll also need to use next@9.4.5-canary.43 until the next minor version. Which example were you trying to run?

Incidentally, I thought I thought I had to use exportTrailingSlash: true. I can’t reproduce using trailingSlash: true in the next.config.js

1reaction
timneutkenscommented, Jul 26, 2020

Sounds like this can be closed then because exportTrailingSlash is something different and should no longer be used when the trailingSlash option is on stable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix internal redirects from trailing slash mismatch?
This issue means that the one URL on your site is redirected to another internal URL. The presence/absence of a trailing slash is...
Read more >
Keep trailing slash in route with default parameter in Symfony ...
Symfony 5.1. I'm updating some legacy code and I need the following routes to match: /article ...
Read more >
How to force https, www and a trailing slash with one redirect
The right way is to make the .htaccess check for the / then check for www. and https:// . If any of our...
Read more >
Ktor should resolve trailing slash as a different URL - YouTrack
(tailcard) does not match URLs ending with '/' ... These requests don't have any trailing slash, but still, Ktor will route them to...
Read more >
How to force trailing slash? - Solved - Kirby forum
Any ideas? Redirect URL with trailing slash to canonical URL without trailing slash. Route Handlers Don't Match with Trailing Slashes.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found