fix: patch node-fetch-native-with-agent to bypass bundled undici on Node 26

node-appwrite 23.1.0 ships a bundled undici Agent via node-fetch-native-with-agent.
That bundle uses an older undici dispatcher API that crashes on Node 26 with
'invalid onError method' (UND_ERR_INVALID_ARG), making every Appwrite call
fail with 'fetch failed' / our user-facing 'Bağlantı hatası' fallback.

The patch replaces createAgent/createFetch with thin pass-throughs to
globalThis.fetch — Node native fetch handles HTTPS to db.kovaksoft.com
directly, no proxy/agent customization needed. Verified end-to-end via
users.listMemberships against the live project.

Also added dev-mode error surfacing in appwriteError so future SDK
exceptions show the real message instead of 'Bağlantı hatası'.
This commit is contained in:
kovakmedya
2026-05-21 19:31:16 +03:00
parent 1dd8627c30
commit 9ea35e88cf
4 changed files with 45 additions and 2 deletions
+2
View File
@@ -1,3 +1,5 @@
allowBuilds:
sharp: true
unrs-resolver: true
patchedDependencies:
node-fetch-native-with-agent@1.7.2: patches/node-fetch-native-with-agent@1.7.2.patch