dillonkearns / elm-pages

Hybrid Elm framework with full-stack and static routes.
https://elm-pages.com
BSD 3-Clause "New" or "Revised" License
658 stars 98 forks source link

Sporadic EPIPE error #485

Closed miniBill closed 3 months ago

miniBill commented 3 months ago

I occasionally get this error:

Trace: elm-pages unhandled HTTP error FetchError: request to http://localhost:9000/cache/autocompletaStazione/Y failed, reason: write EPIPE
    at ClientRequest.<anonymous> (/Users/minibill/src/elm-timetable/script/node_modules/minipass-fetch/lib/index.js:130:14)
    at ClientRequest.emit (node:events:518:28)
    at Socket.socketErrorListener (node:_http_client:500:9)
    at Socket.emit (node:events:518:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  code: 'EPIPE',
  errno: 'EPIPE',
  syscall: 'write',
  type: 'system'
}
    at file:///Users/minibill/src/elm-timetable/script/node_modules/elm-pages/generator/src/request-cache.js:226:19
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

I don't exclude it's an issue with the server, but I feel that elm-pages should "wrap" it anyway, even just as a NetworkError or something

dillonkearns commented 3 months ago

Is this using the Stream API? There's not much I can take a look at without a reproduction, so please make an SSCCE if possible.

miniBill commented 3 months ago

I had it just using BackendTask.Http, but yeah, this bug report is very bad :sweat_smile: I'm going to close it unless I manage to reproduce it with a SSCCE