#console.log Errors When Using Worker Static Assets

8 messages · Page 1 of 1 (latest)

white jetty
#

Hello. I am creating a Worker + Assets application using worker static assets. However, when using static assets, console.log does not output logs correctly.

Even more strangely, sometimes the logs are output correctly, and sometimes they are not. I don't understand the difference between the two cases. One thing is certain: when I'm not using static assets, the logs are reliably output, but when I am using static assets, it's a matter of chance.
I'm guessing, but could this be related to the deployment process?

My repository is here:
https://github.com/calloc134/check-log-issue-worker-assets

My application ID is: a42770fb-7bad-405f-af9a-15f09e2cc8bb

Has anyone else experienced a similar bug?

GitHub

Contribute to calloc134/check-log-issue-worker-assets development by creating an account on GitHub.

turbid violet
#

After I removed the static assets, the logs were displayed normally, so I can be sure that this is the cause of the problem.

white jetty
#

Thank you.
I'm relieved to hear that someone else is encountering the same error. I also spent a whole day trying to identify this error. I've identified the cause, but I don't know how to solve it. Is this a problem with Cloudflare's infrastructure? Workers static assets are a new feature, so perhaps there are bugs like this. I'm eagerly awaiting a fix for this bug.

#

#coding-help message

median apex
#

I wonder if there's a lack of documentation/information for how logs like this work today. You will only see logs when your worker is invoked - if people hit /index.html for example, that won't show up in the logs at all right now.

#

This is because Assets runs ahead of your user worker by default. You can enable run_worker_first in your assets config which'll always invoke your user worker, and then manually env.ASSETS.fetch but then you'll pay for every request - even those for static assets.