Cloudflare Pages logging nukes static assets

I have a working Cloudflare Pages app.
I have a bug when deployed that doesn’t present locally, so I’m trying to use the real-time logging to see what’s going on.
Only problem is, whenever I use it, either in the terminal or in the dashboard it destroys all my static assets for the *.pages.dev deployed version. I have to redeploy to get them back again.
I need them for the app to work.
Anyone seen this? I’ve had it working in the recent past.

Honestly not sure how this would happen.

What is the bug you are trying to track? Is it in front-end JS, a function, other?

It’s a backend bug … in fact my whole app is BE, there’s no FE framework.
I’m serving HTMX from the endpoints, so the FE is just doing AJAX calls and nothing else.
My endpoints return HTML not JSON, so I’m trying to see what’s going on internally in the server errors.
The HTMX Jscript is served as a static asset, so when this crash happens I can’t run the app to test it.
The problem happens on myapp.pages.dev but not on the custom domain, which makes me think it’s a cache issue.

Why do you think the assets get removed? What led you there?
I just tested on my own project and they’re still fine.

It sounds like you’re returning content from Functions so if there’s an error happening there, it won’t be able to return anything

1 Like

so let’s say I have a site that’s been served on example.pages.dev and custom domain https://example.com

Both sites run fine until I run the real-time logging either in the dashboard or in the terminal (using wrangler pages deployment tail … )

The logging function works but the site on example.pages.dev ceases to serve content from the static assets, all return an Error.

However the logging works on https://example.com and the assets are served fine.

When I stop logging it’s still broken until I redeploy the site … and then example.pages.dev works properly again.

We’d really need more info + reproduction to help anymore.

Exceptions happen due to an error in the Function code. You’d need to debug what that error is.

1 Like

these are static assets being served from the static folder.
It feels like something odd is going on with the middleware to interrupt the natural serving of these files when running the logging.