marksfrancis
CDCloudflare Developers
•Created by marksfrancis on 8/16/2024 in #pages-help
Internal build error - says to contact Cloudflare Support
Here's the build output from Cloudflare's pages deployment:
The error only happens when a
_routes.json
file is present in the out directory. AFAIK, this is a supported way of using Pages (advanced mode + _routes.json
to skip having env.ASSETS.fetch
in the worker). This error persists even after retrying (previous attempt has the deployment ID 8a1e52ef-257f-4731-a102-c9432d3fd96a
)
Once I removed the _routes.json
, it started working again (deployment eb9d075a-807c-4d2f-92ff-b8a941b8f162
). Is this not a supported use case?4 replies
CDCloudflare Developers
•Created by marksfrancis on 8/16/2024 in #pages-help
Reference architecture for a pages app with background tasks
I'm looking for a reference architecture for an API / website that also has background tasks, such as queues, cron jobs, etc. Is there a recommended way to build such an app?
I understand that I can use a separate worker and share the same queue (but presumably not in the same codebase?), or I can drop down to "Advanced Mode" with
_worker.js
, but what's the recommended architecture?1 replies
CDCloudflare Developers
•Created by marksfrancis on 7/21/2024 in #pages-help
Image Transforms on pages
I have a pages project with an image transform endpoint.
As far as I can tell, I can't use Cloudflare's image transform features because the pages function isn't running in the same zone as my website's zone. I assume this is because Custom Domains in Pages are really just DNS record aliases - it's not moving the function to run in the Cloudflare zone where Images is enabled. For presumably the same reasons,
wrangler.toml
's routes
option doesn't work either (Configuration file for Pages projects does not support "routes"
).
I still want to have an entire website running, but I want 1 API endpoint which optimises images dynamically.
What's the best way to solve this? For example, do I need to mix and match a separate worker just for the image resize and a pages project for everything else?
- pages.dev: https://fast-images.pages.dev/
- deployment ID: 5839679a
- account ID: a743ed06cad7fe7565e231b80cb268b2
- zone ID (for images): 539e268afac9443cf7dc601b8e8e599d
5 replies