Next >=9.5.4: asPath without trailing slash
See original GitHub issueBug report
Describe the bug
asPath
on SSR without trailing slash.
To Reproduce
- Go to https://codesandbox.io/s/next-954-aspath-demo-qrsxp
- Click on ‘/page’ or ‘/page/’
- See ‘asPath is /page/’
- Reload sandbox browser
- See ‘asPath is /page’ (without trailing slash)
Expected behavior
- Go to https://codesandbox.io/s/next-953-aspath-demo-forked-mvl8t
- Click on ‘/page’ or ‘/page/’
- See ‘asPath is /page/’
- Reload sandbox browser
- See ‘asPath is /page/’ (with trailing slash)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:17 (7 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Next 10.0.3: i can still reproduce this bug. https://codesandbox.io/s/next-1003-aspath-demo-d9ej7
Any updates on this issue?
The issue doesn’t exist in the 11th version, the link to the codesandbox. @Timer @timneutkens should this ticket be closed?