Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…/GetEntityToken" fails with Error: terminated (issue seems to already be resolved at nodejs/undici#2603) - undici is what node's fetch uses behind the scenes - updating to the latest version of undici fixes the issue

Stack trace of the error I was getting:
TypeError: terminated
    at Fetch.onAborted (node:internal/deps/undici/undici:11442:53)
    at Fetch.emit (node:events:514:28)
    at Fetch.terminate (node:internal/deps/undici/undici:10695:14)
    at Fetch.resume (node:internal/deps/undici/undici:11421:36)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  [cause]: Error: incorrect header check
      at Zlib.zlibOnError [as onerror] (node:zlib:189:17) {
    errno: -3,
    code: 'Z_DATA_ERROR'
  }
}
  • Loading branch information
flawiddsouza committed Mar 22, 2024
1 parent fb9079e commit a5fe1b8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 30 deletions.
35 changes: 8 additions & 27 deletions packages/electron/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"chokidar": "^3.6.0",
"electron-context-menu": "^3.6.1",
"electron-squirrel-startup": "^1.0.0",
"undici": "^5.28.2",
"undici": "^6.10.1",
"update-electron-app": "^2.0.1"
},
"config": {
Expand Down
4 changes: 2 additions & 2 deletions packages/electron/src/request.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { File } = require('node:buffer')
const { Agent } = require('undici')
const { fetch, Agent } = require('undici')
const { Socket } = require('net')
const dnsPromises = require('dns').promises

Expand Down Expand Up @@ -123,7 +123,7 @@ async function handleSendRequest(data) {
console.error('request failed', e)
return {
event: 'responseError',
eventData: e.message
eventData: e.stack + (e.cause ? '\n' + e.cause?.stack : '')
}
} finally {
delete abortController[data.requestId]
Expand Down

0 comments on commit a5fe1b8

Please sign in to comment.