next-runtime
next-runtime copied to clipboard
[Bug]: Issue with trailingSlash: true not working in recent version of the plugin
Summary
Have an issue with trailing slashes not working on Netlify when using trailingSlash: true in the next.config.js file. When visiting /test it doesn't redirect to /test/ . Tested on both version 4.1.0 and 4.2.0 of netlify-plugin-nextjs.
Steps to reproduce
In the next.config.js file:
module.exports = {
reactStrictMode: true,
trailingSlash: true,
}
Site with version 4.1.0. Visit site, add /test to the url. GitHub repo of site.
Site with version 4.2.0 of the plugin. Visit site, add /test to the url. GitHub repo
A link to a reproduction repository
https://github.com/MelvinPeepers/next_trailing_slash
Plugin version
4.2.0
More information about your build
- [ ] I am building using the CLI
- [ ] I am building using file-based configuration (
netlify.toml)
What OS are you using?
No response
Your netlify.toml file
`netlify.toml`
# Paste content of your `netlify.toml` file here
Your public/_redirects file
`_redirects`
# Paste content of your `_redirects` file here
Your next.config.js file
`next.config.js`
# Paste content of your `next.config.js` file here. Check there is no private info in there.
Builds logs (or link to your logs)
Build logs
# Paste logs here
Function logs
Function logs
# Paste logs here
.next JSON files
generated .next JSON files
# Paste file contents here. Please check there isn't any private info in them
# You can either build locally, or download the deploy from Netlify by clicking the arrow next to the deploy time.
@MelvinPeepers is this a regression? If so, do you have a repro where it does work?
I don't get the read that the customer has seen it work before; seems they are porting their wordpress site to next.js. I have asked them to confirm that it isn't something they've had working here before and if so which version of the plugin it was with.
I don't think this is possible, because these are static HTML files. It works with dynamic pages, but it doesn't work with static pages that are served from the CDN. The workaround is to make them ISR, with a long timeout (but under a year).
I'm also having this issue with my site!
Weird thing is that it's working when using netlify dev locally.
Was someone able to fix it?
Closing as duplicate, will be solved in #1448