DaveJ
CDCloudflare Developers
•Created by DaveJ on 10/14/2024 in #workers-help
Using vitest without defining `nodejs_compat` for my worker
I am following the instructions here: https://developers.cloudflare.com/workers/testing/vitest-integration/get-started/write-your-first-test/
It says that:
In your project’s wrangler.toml configuration file, […] include nodejs_compat in your compatibility flags.My lib doesn't need that flag so it seems a bit silly just to enable it for tests. Is there a way to run tests without that flag?
10 replies
CDCloudflare Developers
•Created by DaveJ on 5/24/2023 in #general-help
Cloudflare Image resizing giving error 9524
I am using Cloudflare Image Resizing but it has stopped working(error
9524
) for some URLs recently. Here is an example URL that is now broken: https://www.todesktop.com/cdn-cgi/image/width=96,height=96,f=auto/https://793ac95a.website-7p8.pages.dev/_app/immutable/assets/customer-logo-ReadyRunner.03a9daf5.png
And here is the source image: https://793ac95a.website-7p8.pages.dev/_app/immutable/assets/customer-logo-ReadyRunner.03a9daf5.png
Any idea why it is broken and how to fix it?2 replies
CDCloudflare Developers
•Created by DaveJ on 5/15/2023 in #general-help
Cloudflare Image Resizer returning 404 but the source image does not return a 404.
Here is the URL I am trying to request:, it is giving a 404 <snip>
Here is the source URL: <snip>
Here is another similar URL which works fine: <snip>
What might be going on here?
5 replies
CDCloudflare Developers
•Created by DaveJ on 5/4/2023 in #pages-help
Cloudflare Image resizing giving error 9524
I am using Cloudflare Image Resizing but it has stopped working for some URLs recently. Here is an example URL that is now broken: https://next.todesktop.com/cdn-cgi/image/width=640,f=auto/https://860818f9.website-7p8.pages.dev/_app/immutable/assets/bg.90a72a2b.jpg
Any idea why it is broken and how to fix it?
3 replies
CDCloudflare Developers
•Created by DaveJ on 4/12/2023 in #pages-help
How do I get Cloudflare Image resizing working with Cloudflare Pages deployment preview URLs?
Is it possible to use Image resizing with Cloudflare Pages automatic deployment URLs? I want to be able to request an image like this...
https://4222d427.my-website.pages.dev/cdn-cgi/image/width=48,height=48,f=auto/_app/immutable/assets/test-6fef8284.jpeg
But currently, I need to merge to production before the image starts to work. Is there any way to get this working using the branch preview URL?
3 replies
CDCloudflare Developers
•Created by DaveJ on 3/29/2023 in #pages-help
Does Cloudflare Pages have any integrated support for Cloudflare Images
I assumed that Cloudflare Pages had support for image optimisation out-of-the-box, like Vercel does. But I can't find anything. Do I have to upload images to Cloudflare Images as a completely separate process? Is there any script available for doing this?
8 replies
CDCloudflare Developers
•Created by DaveJ on 3/23/2023 in #pages-help
Purge cache on Pages workers
I am using fetch and the Cloudflare cache API to cache some content. The problem is that I'm unable to figure out how I can purge that cache. I've tried two things:
1. The Cloudflare UI (Caching -> Configuration -> Purge Cache -> Custom Purge_
2. Posting the URLs to Cloudflare API (https://api.cloudflare.com/client/v4/zones/ZONE_ID/purge_cache)
Neither seems to invalidate the cache for me. The URL that I'm trying to invalidate is a GET request to the GitHub API.
5 replies
CDCloudflare Developers
•Created by DaveJ on 3/21/2023 in #pages-help
403 forbidden when querying github API from Cloudflare
I am doing a
fetch
request to get latest releases from a GitHub repo. It is working fine on my localhost machine but when I push it Cloudflare it returns a 403 error.
What could be going on?12 replies