httptoolkit / httptoolkit-ui

The UI of HTTP Toolkit
https://httptoolkit.com
GNU Affero General Public License v3.0
282 stars 106 forks source link

Fonts fetch failures #111

Closed Fr0stM0urne closed 4 months ago

Fr0stM0urne commented 4 months ago

Running ui locally using npm run start:web. Constantly failing to fetch font urls such as https://gwfh.mranftl.com/api/fonts, https://gwfh.mranftl.com/api/fonts/lato?subsets=latin.

This results in Uncaught Exceptions.

httptoolkit-ui/node_modules/node-fetch/lib/index.js:1491
            reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));

FetchError: request to https://gwfh.mranftl.com/api/fonts failed, reason: 
    at ClientRequest.<anonymous> (httptoolkit-ui/node_modules/node-fetch/lib/index.js:1491:11)
    at ClientRequest.emit (node:events:518:28)
    at TLSSocket.socketErrorListener (node:_http_client:495:9)
    at TLSSocket.emit (node:events:518:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at processTicksAndRejections (node:internal/process/task_queues:82:21)
    at runNextTicks (node:internal/process/task_queues:64:3)
    at listOnTimeout (node:internal/timers:540:9)
    at processTimers (node:internal/timers:514:7)

Possibly network issues on my end. However, is it worthwhile/possible to have the fonts downloaded locally and local content is accessed if there is a failure in URL fetch?

pimterry commented 4 months ago

Ah, that's interesting, hmm.

There are some substantial font changes coming here soon which will resolve this anyway, so for now I think it's not worth properly this, sorry! The dependency on that service will go away completely within the next couple of weeks for a totally different approach, so I'll close this issue.

In the meantime though, if this is causing problems for you then you can probably work around this most easily by just disabling that webpack plugin entirely (commenting out this block). You'll end up with slightly wrong fonts, but that's probably fine for the short term. If you really want the 'right' fonts on your local setup, you could download and install them locally, and then everything will work without any 3rd party fonts required at all.