-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Infinite network requests/refresh loop while accessing docs #5055
Comments
If you look at the served page, it is serving a redirect file: <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="0; url=/stable/getting-started/overview">
<link rel="canonical" href="/stable/getting-started/overview" />
</head>
<script>
window.location.href = '/stable/getting-started/overview';
</script>
</html> I suspect your usage of redirect plugin creates an edge case where the original file gets overriden by the redirect file:
Normally there's a security that prevents this from happening (build is supposed to fail) Maybe you can investigate why the redirect plugin is overriding the file at If there's additional security to add to the redirect plugin to prevent this, a smaller repro would be helpful. |
Hi, FYI while building locally. This error is shown in console. This error exists even after
The redirect plugin function above just does three things:
The same redirect configuration was used from past week and was working as expected. Also the function works fine when local build is served at port 3000. It successfully:
|
Update: Checked the website with same redirect plugin functions using Site Deployed link using All the above redirect functions work properly. |
@CovalentBond debugging this is likely extremely time-consuming for me. Just cloning your repo takes forever 😅 Please try to debug this and provide all the relevant infos. If you can show me 2 PR with deploy previews, one on beta.0, one on beta.2, I can inspect the code that belongs to a given deployment, being sure no mistake was done. Also please try to remove the redirects until you are able to get a This might also be related to the new If you can create me 2 zip of a representative folder in |
Deploy preview
The first For the other two BuildsAll the builds for each preview can be find on Google Drive. Each build size ~ 400MB seem to exceed GitHub's file size limit. Another Issue❗️The deploy made using Most probably the banner shown is also for the website which are falling under the First Versioning usecase. Our versioning configuration is like
|
I got a "freeze" of the webpage after navigating to any other page from the first page in beta2. The first page itself is fine. Firefox has shown a warning that "this webpage is slowing down your computer" and a JS console log that says "maximum update depth exceeded" with the following log:
|
Thanks @CovalentBond , investigating now @achimnol That looks unrelated to the current issue. Can you please open another bug report linking with more info and a repro/public repo? That looks like a regression we also need to fix, but I don't know how to reproduce it yet. |
@CovalentBond on beta.2 we have some breaking changes regarding the version banner you talk about. Unexpectedly, your site still builds fine despite this breaking change. This is because I publish docusaurus official releases from my local computer and didn't run any cleanup before the publish, so the dist folder still contains the old component (will fix that). Not upgrading this code for beta.3 and canary releases would give you an error such as:
Now let's go back to our redirect problem. Here's what has changed: beta.0
beta.2
The I'm thinking about reverting this behavior change of the redirect plugin for better retro-compatibility. However, some important things to consider:
In general, I created https://github.com/slorber/trailing-slash-guide to hep you figure out these problems by exposing the differences between different static hosts You should be able to fix this problem today by using one of those 2 potential solutions, but I'd recommend both of them. |
Thank you so much @slorber the banner issue has been solved. But I don't think Netlify redirects Check this https://60db55aebb09341de57576a1--zowe-docs-testing.netlify.app/v1.21.x/user-guide/installandconfig.html (Created with This could also be reproduced with the Preview link generated of PR #5085 on Netlify. It gives Page Not Found. |
Update: Checked with trailingSlash undefined & using But with If any link is |
Ah yes I agree, Netlify is able to serve Also highlighted by on my table here: https://github.com/slorber/trailing-slash-guide I've reverted the behavior of emitting My test deployment (https://github.com/slorber/zowe-test) seems to work better now:
The issue affecting our deploy preview should not affect you, but I'll fix it (it's only when using |
Alright, so it looks like all the reported issues have been fixed, let me know if you still find anything weird. I think you'll have to keep using |
Not related to this issue, but is there any way we can optimize/minify the static files. The size of our static f/older case is more than 400MB. The size probably seem to increase with every version added. It massively increases our build size and time. Since Docusaurus does not optimize static files by default. Can you tell me how can we optimize it PS. It would be really great if Docusaurus by default could optimize the static files. Related issue: #568 |
It's not clear what you mean. Which static file type, and which optimization? We don't optimize an image in the same way we optimize a JS/CSS file. JS/CSS files already already optimized in Terser / cssnano HTML files are also optimized by Webpack (afaik)
If you have 10 versions, you have 10x more HTML files, and having increased build times and deployment size is totally expected, this is one of the drawbacks of Jamstack / static site generators That's also why other big players in this field work on solving this issue:
We don't offer such a solution for now (it is not something easy provide), apart Webpack 5 caching that improves rebuild-time if you persist Note on versioning:
I plan to write some performance/scalability guide. If you have doc versions that you do not maintain anymore, you'd rather move them out of your site, so that they don't impact your build time anymore. Look at what we do on the Docusaurus site itself: not all versions are on the site, and older versions can remain accessible by using archived standalone deployments, external link added to the end of the dropdown: |
Note, as you are using Netlify, to leverage Webpack 5 caching (much faster rebuild times), you can use the Netlify cache plugin, as we do on the Docussaurus site: https://github.com/facebook/docusaurus/blob/master/website/netlify.toml#L22 |
In the static folder, we are directly serving various HTML, CSS & JS files in every version which are being rendered like this. As mentioned in the Docusaurus Documentation, these files in the static folder are not post-processed or minified. I was asking if we can further optimize these files and save some more time.
Yes, we have been planning to archive old doc versions and seperate it as done on the Docusaurus website. It might significantly improve build time!
Thanks I will take a look! |
Everything inside /static should be optimized by your own means. I won't do anything to these files |
🐛 Bug Report
Infinite refresh & network request loops are made while accessing any other page except the homepage.
This issue does not occurs when a doc page is navigated from homepage.
This issue only occurs when the website is deployed. Not when the build is locally served and tested.
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
Have you read the Contributing Guidelines on issues?
Yes
Steps to reproduce
OR
Steps to build the website locally
git clone --branch zowe-docs-v2 https://github.com/zowe/docs-site.git
npm install
npm run build
and deploy at a URLExpected behavior
The doc page is expected to load up normally.
Actual behavior
The doc page does not loads up.
Your environment
The text was updated successfully, but these errors were encountered: