Draft
Fix recaptcha errors by removing Request cloning in service worker#26
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders Open Preview |
Co-authored-by: sriail <225764385+sriail@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix recaptcha fetch error in service worker
Fix recaptcha errors by removing Request cloning in service worker
Nov 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Service worker was cloning Request objects with consumed ReadableStream bodies, causing
TypeError: Failed to construct 'Request': The provided ReadableStream is disturbedand cascading failures in recaptcha/captcha loading.Changes
enhanceCaptchaRequest()function and CAPTCHA domain checking that attempted to create new Request objects from consumed streamsuv.fetch()andsj.fetch()now receive unmodified fetch events, allowing their built-in CAPTCHA handling to work correctlyBefore
After
Both Ultraviolet and Scramjet include CAPTCHA handling when given the original fetch event.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
telemetry.astro.buildnode /home/REDACTED/work/Radius/Radius/node_modules/.bin/astro build(dns block)node /home/REDACTED/work/Radius/Radius/node_modules/.bin/astro dev(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
when trying to load a recapta, the console dysplays this error scramjet.all.js:1 %cg -> g%c Creating SingletonBox
background-color: #f80;
color: #fff;
padding: 4px;
font-weight: bold;
font-family: monospace;
font-size: 0.9em;
print @ scramjet.all.js:1
scramjet.all.js:1 ERROR FROM SERVICE WORKER FETCH: Object
m @ scramjet.all.js:1
scramjet.all.js:1 TypeError: Failed to construct 'Request': The provided ReadableStream is disturbed
at S.fetch (scramjet.all.js:1:102867)
at d.m (scramjet.all.js:1:89992)
at async sw.js:1:1353
m @ scramjet.all.js:1
:8080/
/scramjet/https%3A%2F%2Fwww.google.com%2Fgen_204%3Fs%3Dweb%26t%3Daft%26atyp%3Dcsi%26ei%3DBPsaaf-dC-K05NoP9JWJqAI%26rt%3Dwsrt.612%2Chst.417%2Csct.479%2Cfrts.524%2Cfrvt.524%2Cprt.711%2Cafts.567%2Caft.567%26imn%3D11%26dtc%3D596%26stc%3D170%26ima%3D0%26imad%3D0%26imac%3D2%26wh%3D593%26nt%3Dnavigate%26dt%3Dcache%26ts%3D0%26nhp%3D%26opi%3D89978449:1 Failed to load resource: the server responded with a status of 500 ()/scramjet/https%3A%2F%2Fogads-pa.clients6.google.com%2F%24rpc%2Fgoogle.internal.onegoogle.asyncdata.v1.AsyncDataService%2FGetAsyncData:1 Failed to load resource: the server responded with a status of 500 ()scramjet.all.js:1 ERROR FROM SERVICE WORKER FETCH: Object
m @ scramjet.all.js:1
scramjet.all.js:1 TypeError: Failed to construct 'Request': The provided ReadableStream is disturbed
at S.fetch (scramjet.all.js:1:102867)
at d.m (scramjet.all.js:1:89992)
at async sw.js:1:1353
m @ scramjet.all.js:1
scramjet.all.js:1 Uncaught ReferenceError: registration is not defined
:8080/
2scramjet.all.js:1 CAUGHT ERROR RpcError(UNKNOWN): Rpc failed due to xhr error. uri: https://ogads-pa.clients6.google.com/$rpc/google.internal.onegoogle.asyncdata.v1.AsyncDataService/GetAsyncData, error code: 6, error: [500]
t.$scramerr @ scramjet.all.js:1
scramjet.all.js:1 ERROR FROM SERVICE WORKER FETCH: Object
m @ scramjet.all.js:1
scramjet.all.js:1 TypeError: Failed to construct 'Request': The provided ReadableStream is disturbed
at S.fetch (scramjet.all.js:1:102867)
at d.m (scramjet.all.js:1:89992)
at async sw.js:1:1353
m @ scramjet.all.js:1
:8080/url?sa=t&source=web&rct=j&opi=89978449&url=https://www.google.com/recaptcha/api2/demo&ved=2ahUKEwj_r9KF__iQAxViGlkFHfRKAiUQFnoECAwQAQ:1 Failed to load resource: the server responded with a status of 404 (Not Found)
scramjet.all.js:1 CAUGHT ERROR TypeError: Failed to fetch
t.$scramerr @ scramjet.all.js:1
scramjet.all.js:1 ERROR FROM SERVICE WORKER FETCH: Object
m @ scramjet.all.js:1
scramjet.all.js:1 TypeError: Failed to construct 'Request': The provided ReadableStream is disturbed
at S.fetch (scramjet.all.js:1:102867)
at d.m (scramjet.all.js:1:89992)
at async sw.js:1:1353
m @ scramjet.all.js:1
scramjet.all.js:1 g initializing scramjet client
scramjet.all.js:1 g -> g Creating SingletonBox
print @ scramjet.all.js:1
scramjet.all.js:1 g initializing scramjet client
scramjet.all.js:1 CAUGHT ERROR Array(3)
t.$scramerr @ scramjet.all.js:1
scramjet.all.js:1 CAUGHT ERROR Array(3)
t.$scramerr @ scramjet.all.js:1
scramjet.all.js:1 CAUGHT ERROR Array(3)
t.$scramerr @ scramjet.all.js:1
scramjet.all.js:1 CAUGHT ERROR Array(3)
t.$scramerr @ scramjet.all.js:1
scramjet.all.js:1 CAUGHT ERROR Array(3)
t.$scramerr @ scramjet.all.js:1
scramjet.all.js:1 CAUGHT ERROR Array(3)
t.$scramerr @ scramjet.all.js:1
scramjet.all.js:1 CAUGHT ERROR Array(3)
t.$scramerr @ scramjet.all.js:1
scramjet.all.js:1 CAUGHT ERROR Array(3)
t.$scramerr @ scramjet.all.js:1
scramjet.all.js:1 CAUGHT ERROR Array(3)
t.$scramerr @ scramjet.all.js:1
scramjet.all.js:1 CAUGHT ERROR Array(3)
t.$scramerr @ scramjet.all.js:1
scramjet.all.js:1 CAUGHT ERROR Array(3)
t.$scramerr @ scramjet.all.js:1
scramjet.all.js:1 CAUGHT ERROR Array(3)
t.$scramerr @ scramjet.all.js:1
scramjet.all.js:1 CAUGHT ERROR Array(3)
t.$scramerr @ scramjet.all.js:1
scramjet.all.js:1 CAUGHT ERROR Array(3)
t.$scramerr @ scramjet.all.js:1
scramjet.all.js:1 CAUGHT ERROR Array(3)
t.$scramerr @ scramjet.all.js:1
scramjet.all.js:1 CAUGHT ERROR Array(3)
t.$scramerr @ scramjet.all.js:1
scramjet.all.js:1 CAUGHT ERROR Array(3)
t.$scramerr @ scramjet.all.js:1
scramjet.all.js:1 CAUGHT ERROR Array(3)
t.$scramerr @ scramjet.all.js:1
scramjet.all.js:1 CAUGHT ERROR Array(3)
t.$scramerr @ scramjet.all.js:1
scramjet.all.js:1 CAUGHT ERROR Array(3)
t.$scramerr @ scramjet.all.js:1
scramjet.all.js:1 CAUGHT ERROR Array(3)
t.$scramerr @ scramjet.all.js:1
scramjet.all.js:1 CAUGHT ERROR Array(3)
t.$scramerr @ scramjet.all.js:1
scramjet.all.js:1 CAUGHT ERROR Array(3)
t.$scramerr @ scramjet.all.js:1
scramjet.all.js:1 CAUGHT ERROR Array(3)
t.$scramerr @ scramjet.all.js:1
scramjet.all.js:1 CAUGHT ERROR Array(3)
t.$scramerr @ scramjet.all.js:1
scramjet.all.js:1 CAUGHT ERROR Array(3)
t.$scramerr @ scramjet.all.js:1
scramjet.all.js:1 CAUGHT ERROR Array(3)
t.$scramerr @ scramjet.all.js:1
scramjet.all.js:1 CAUGHT ERROR Array(3)
t.$scramerr @ scramjet.all.js:1
scramjet.all.js:1 C...
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.