You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There appear to be two issues that prevent logtape from working on Cloudflare Workers:
Cloudflare Workers fails on the import of node:fs as it isn't supported, even under node compat mode. I suspect this can be worked around by expanding the filesink.web.ts to be a full implementation and determine and then dynamically load that.
The LoggerImpl uses WeakRef, which Cloudflare Workers don't support. They claim there are some limitations/challenges to this, though the details are very vague. In logtape, this appears to be isolated to managing "child" loggers so that that they can be enumerated but not hold a strong reference so any children can be GC'ed. I don't know of an easy workaround to this.
The text was updated successfully, but these errors were encountered:
Given the short lifetime of edge functions like Cloudflare Workers, it might not be necessary to use WeakRefs in that environment. I'm not sure though. 🤔
There appear to be two issues that prevent logtape from working on Cloudflare Workers:
node:fs
as it isn't supported, even under node compat mode. I suspect this can be worked around by expanding thefilesink.web.ts
to be a full implementation and determine and then dynamically load that.LoggerImpl
usesWeakRef
, which Cloudflare Workers don't support. They claim there are some limitations/challenges to this, though the details are very vague. In logtape, this appears to be isolated to managing "child" loggers so that that they can be enumerated but not hold a strong reference so any children can be GC'ed. I don't know of an easy workaround to this.The text was updated successfully, but these errors were encountered: