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.

Next >=9.5.4: asPath without trailing slash

See original GitHub issue

Bug report

Describe the bug

asPath on SSR without trailing slash.

To Reproduce

  1. Go to https://codesandbox.io/s/next-954-aspath-demo-qrsxp
  2. Click on ‘/page’ or ‘/page/’
  3. See ‘asPath is /page/’
  4. Reload sandbox browser
  5. See ‘asPath is /page’ (without trailing slash)

Expected behavior

  1. Go to https://codesandbox.io/s/next-953-aspath-demo-forked-mvl8t
  2. Click on ‘/page’ or ‘/page/’
  3. See ‘asPath is /page/’
  4. Reload sandbox browser
  5. See ‘asPath is /page/’ (with trailing slash)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:17 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
fostyfostcommented, Nov 29, 2020

Next 10.0.3: i can still reproduce this bug. https://codesandbox.io/s/next-1003-aspath-demo-d9ej7

Any updates on this issue?

1reaction
LetItRockcommented, Jul 2, 2021

The issue doesn’t exist in the 11th version, the link to the codesandbox. @Timer @timneutkens should this ticket be closed?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can you handle trailing slashes in next.js routes?
There is an option with Next.js 9.5 and up. In next.config.js , add the trailingSlash config: module.exports = { trailingSlash: true, }.
Read more >
Trailing Slash - next.config.js
Configure Next.js pages to resolve with or without a trailing slash.
Read more >
Next js trailing slash redirect
By default Next.js will redirect urls with trailing slashes to their counterpart without a trailing slash. For example /about/ will redirect to /about....
Read more >
next 9.5.4 on Node.js NPM - NewReleases.io
Specially encoded paths could be used with the trailing slash redirect to allow an open redirect to occur to an external site.
Read more >
To slash or not to slash | Google Search Central Blog
Historically, it's common for URLs with a trailing slash to indicate a directory, and those without a trailing slash to denote a file:....
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