Closed betimshahini closed 1 year ago
I'm seeing the same issue (using Remix on Cloudflare workers) in the same https://github.com/tygern/remix-otel-issue that we used as an example for a previous issue (https://github.com/evanderkoogh/otel-cf-workers/issues/17). You can reproduce by running npm run build && npm run start
, then you'll see TypeError: Illegal invocation
for all static assets. If you add bypassCache: true
to getAssetFromKV
's cacheControl
config in server.ts (line 38) then everything works as expected.
Yeah, I need to have a look into what is going on there.. But I am a bit under the pump these days, so it might take a while..
When I update the otel package to the latest rc.10
version everything seems to work. Did a bunch of work in between to make wrapping things into Proxies a bit more robust when libraries do funky things, so this might have been one of those things. Please re-open if you still see this issue.
When using Cloudflare's kv-asset-handler, there are instances where the auto-instrumentation results in
Illegal invocation
errors, causing the request to be cancelled in the CF Workers environment. More specifically, when setting thebypassCache: false
flag in the params of thegetAssetFromKV()
call is when this can be reproduced consistently when there are multiple items in cache.Repro branch - URL pointing to the file with the interesting bits: https://github.com/proofzero/rollupid/blob/spike/otel-cf-workers-repro/apps/passport/server.ts
Steps to run locally:
No issues locally; when workers is deployed to CF and hard-refreshed in the browser a few times (likely to cause some cache hits/misses), you'll see
TypeError: Illegal invocation
logs inwrangler tail
.