rdilweb / docusaurus-plugin-remote-content

A Docusaurus plugin to download content from remote sources when it is needed.
MIT License
94 stars 12 forks source link

`yarn start` rebuilds continuously #25

Closed gotson closed 2 years ago

gotson commented 2 years ago

When using the plugin, and after running yarn start, the client rebuilds continuously. See video:

https://user-images.githubusercontent.com/2139133/146304493-30f60746-8e71-4347-a5f1-ed9bf3023170.mov

RDIL commented 2 years ago

Hey @gotson, thanks for letting me know. Can you share your config, so I can try to reproduce? Or, if the repository is public, a link to it would also work.

Thank you!

gotson commented 2 years ago

Hey @gotson, thanks for letting me know. Can you share your config, so I can try to reproduce? Or, if the repository is public, a link to it would also work.

Thank you!

Hi, the repository is public, you can find it here. It also pulls public files.

For the moment i set noRuntimeDownloads: true, to avoid the problem, you can try changing it to false. It doesn't always start looping straight away, but after changing some other unrelated files, it will.

RDIL commented 2 years ago

Thanks for the heads up. I'll take a look for you on Monday.

RDIL commented 2 years ago

Alright, so the problem is that docusaurus doesn't support plugins that need to be async, so I'll try to handle this upstream.

RDIL commented 2 years ago

At this point, there isn't really anything I can do. Waiting on upstream (cc @Josh-Cena)

Josh-Cena commented 2 years ago

Hey, plugins can now be asyncly inited, just waiting for the next release

anarwal commented 2 years ago

@Josh-Cena I see there was a new release recently. Was the fix applied for this along with new release?

RDIL commented 2 years ago

I'm going to see if I can get a release out in the next 2-3 days to fix this.

RDIL commented 2 years ago

Alright, working on a fix for this now. Sorry for the delay!

Regarding the fix, going to link here in the code for anybody that reaches the error message that states the content didn't get downloaded yet. Either the download has failed, or the plugin was not awaited by Docusaurus (the ability to do this was introduced in v2.0.0-beta.15, so you need to be using this version or later).