-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Cloudflare 404 for not excluded files in _routes.json with trailingSlash option #8708
Comments
The behaviour you're looking for can be achieved by changing // +page.js
export const prerender = 'auto'; // server will redirect '/bin/cat' to '/bin/cat/'
export const trailingSlash = 'always'; or you can include this in the file
When using With
Perhaps this can be documented more thoroughly for people looking to retain the trailing slash redirection. |
The most weird thing is that ~100 routes work correctly (that are excluded in cf routes config), and ~3900 are 404. Imho, behavior should be consistent anyway. |
I set up this reproduction to test the behaviour of the |
I will fake data and share my project. I need some time. Thank you for your interest. |
@s3812497 please, take a look at this video: with-slash.movI am preparing the project. |
I will not make video without |
Interestingly, I can access the prerendered page data https://5f68ec0e.binaries-web.pages.dev/bin/cat/__data.json but not the prerendered page itself https://5f68ec0e.binaries-web.pages.dev/bin/cat/index.html Now I wonder if removing all the entries in |
You are right! __data.json is accessible, but not the .html! It is some kind of magic 🙂 |
Describe the bug
If we have 100+ routes (actually ~4000) for prerender all routes that are NOT in excluded list:
like
/bin/cat
gives 404. But we havebin/cat/index.html
file locally. So prerender works 100% correct. It is not missing file.Removing
export const trailingSlash = 'always';
seems like fixed that. It was quite easy after finding issue #8422 andneed to check that prerendered pages (with/without trailing slashes) will still work with this setup.
statement :)Reproduction
This 4000+ routes are rendered from private SQLite, but I can share this project with some of your developers by email.
Video: #8708 (comment)
Logs
No response
System Info
Severity
serious, but I can work around it
Additional Information
No response
The text was updated successfully, but these errors were encountered: