-
Notifications
You must be signed in to change notification settings - Fork 12
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
Fast Refresh infinite loop #51
Comments
You need to update your |
Updated it to 2.2.0 and still looping |
@alebanzas did you update all your |
I also have the same behavior of looping while on docusaurus 2.2.0 |
@doroncy same project? |
Hey 🙋🏼 I think I'm seeing the same issue. All docusaurus packages are version 2.2.0. It runs once on startup, but then it seems to create an infinite loop whenever I modify or remove a file. I've primarily been working with the sidebar and docusaurus.config files, but saw the same when deleting other files picked up by docusaurus. I'd be happy to provide any more details if you need them. And for the record: I have no affiliation with the other reporters in this thread, so it's a different project. |
Hey all, so to be honest, I have no idea what's causing this. I've asked the maintainers of Docusaurus to take a look, as they probably will know. I'm sorry this is still happening and causing frustration! |
Thanks for the update! And that's perfectly fine 😁 It's pretty benign, just a little annoying 💁🏼 I worked with it a bit today and found that some things seem to trigger it, while others don't: Changing docusaurus.config (as you might do when you're first setting up the plug-in) definitely does. Deleting a file created by the plugin also seems to cause it. On the other hand, changing other, unrelated files did not trigger it for me, I think. I also think that changing a file that was require'd by the Docusaurus config was okay (but I would need to double check that to be 100%). So once it's set up, I think it should be mostly fine from there. Still, it'd be nice to get to the bottom of it, but I don't think anyone should be losing sleep over it |
Same issue here 🤚 Looking forward to the resolution. Thanks for the plugin btw. 🙏 |
note: if you set |
This change sets `noRuntimeDownloads` to `true` for `plugin-remote-content'` to avoid the infinite loop issue mentioned in rdilweb/docusaurus-plugin-remote-content#51, as described in https://github.com/rdilweb/docusaurus-plugin-remote-content#noruntimedownloads. I suspect that this will require you to generate the files before running the doc build, which may be an issue. However, this does stop the doc from building over and over.
…4596) This change sets `noRuntimeDownloads` to `true` for `plugin-remote-content'` to avoid the infinite loop issue mentioned in rdilweb/docusaurus-plugin-remote-content#51, as described in https://github.com/rdilweb/docusaurus-plugin-remote-content#noruntimedownloads. It also updates some of the yarn scripts to generate the required files before `yarn start`, `yarn build`, and `yarn deploy`. To manually generate the files, run: ```bash yarn docusaurus download-remote-content-external yarn docusaurus download-remote-content-sdks ```
Hey, I happened to run into this same issue yesterday trying to write a Docusaurus plugin with similar functionality. (I was looking at this plugin's code as a reference, which is how I ended up here.) I figured out a way to work around the issue, so I thought I'd share the solution here. The problem is that anytime a file is updated in a directory that's watched by any plugin, a reload is triggered and the The solution I came up with is to only write to
For scenario 1 above, I had to write some code to check if the file I'm about to write to For scenario 3 above, I had to move my "cleanup" code to the end of my Even with these changes, there will still be at least one unnecessary reload because of the write to I hope this helps! |
Also, see facebook/docusaurus#4138 for a proposed "middleware" feature to official Docusaurus plugins that I think would solve this problem. |
Interesting discovery, thanks for letting me know. I'll keep a watch on the middleware proposal, and in the meantime, I'm happy to review any PRs that anyone sends to fix the bug - I don't currently have time to fix it myself sadly. |
localhost keeps hot reloading even though no changes are made
docusaurus.config.js
The text was updated successfully, but these errors were encountered: