-
Notifications
You must be signed in to change notification settings - Fork 87
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
Storyblok client throttling crashing Astro adapter in CloudFlare Worker #682
Comments
We'll address this one. |
I was happy to find this reported issue after going down the exact same path as the original reporter with the exact same set of tools. Is there any estimation on a potential fix for this? Thank you |
@thiagosaife Any updates on this one? We currently omit the client (and created our own fetcher), since it makes all our production sites crash...this should not be the case! |
@patrick-schneider-latori it would be good if you could post your solution or even make a PR with your changes. |
Is there any way to prioritise this? Like some other commenters, we have fallen down this rabbit hole and have not been able to sort it out, before finding this issue. |
Also the same problem with this using hydrogen shopify. |
I have to admit that I've been eagerly waiting for a solution to this problem for months, like many of you. Today, I decided to dive deeper into the code of both this repository and the @storyblok/astro repository to see if I could contribute a solution myself. To my surprise, I discovered that we can adjust the // in your astro.config.mjs
// ...
storyblok({
accessToken: env.STORYBLOK_TOKEN,
apiOptions: {
// ...
rateLimit: 250,
// ...
},
// ...
})
// ... I hope this solution helps others who are encountering the same issue. If anyone has further insights or alternative solutions, I encourage you to share them with the community. 🙂 |
We have the same problem with Cloudflare Workers. Even with rateLimit at 250. Is Storyblok still working on this problem? |
Hi @remi-freriks let me discuss it internally. |
I really hope you find a final solution now @alvarosabu – this problem exists since months and your module is unusable for Cloudflare users. |
@Soviut we are just using simple url fetch. no rocket science involved. But it gives a lot of pain and manual adjustments involved when you want to integrate this in Typescript... |
Hi @patrick-schneider-latori did you try this workaround suggested here #682 (comment) ? |
Hi @alvarosabu – no, we did not, since we need a robust and working solution for our customers, which all have high traffic. And according to what @remi-freriks it also does not make me happy. Therefore we still stick with native fetch and url parameters, since this solution is also compatible with Cloudflare caching and battle-tested on high traffic websites. |
Hi @patrick-schneider-latori thanks for getting back, that made absolute sense, let me get it to the team to prioritize it and hopefully work on it soon. Thanks for the patience |
I have a project using Astro. Astro has a CloudFlare Worker "adapter" for doing server side rendering (SSR). This will re-render the preview page every time someone hits "save" in the Storyblok editor.
However, after several consecutive saves, the worker eventually crashes, giving a "The script will never generate a response" error.
Based on the comment in this thread, it seems to be caused by throttling in the Storyblok client not resolving all its promises and therefore never returning a result. withastro/adapters#43 (comment)
They include links to the code in question as well as some workaround code to monkey patch the Storyblok client.
Expected Behavior
I should be able to save frequently without the Storyblok client failing.
Current Behavior
Saving frequently causes the client to eventually fail, crashing the worker.
Steps to Reproduce
The author of the original thread provided a Stackblitz to reproduce https://stackblitz.com/edit/github-tkyzda-4d7fjz?file=astro.config.mjs
generateStaticPaths
function for Astro that calls Storyblok https://www.storyblok.com/tp/create-a-preview-environment-for-your-astro-websiteThe text was updated successfully, but these errors were encountered: