feat-agency / vite-plugin-webfont-dl

⚡ Webfont Download Vite Plugin - Make your Vite site load faster
MIT License
302 stars 11 forks source link

read: ECONNRESET #26

Closed SeryiBaran closed 1 year ago

SeryiBaran commented 1 year ago

Hello!

Sometimes there is a read: ECONNRESET error, what should I do?

Pastebin with logs: https://pastebin.com/S7DWSZ9P

Url is correct.

No config, google fonts included via link:css (variant a from readme).

0xb4lint commented 1 year ago

Hi @SeryiBaran!

ECONNRESET means some communication issue happened between the server and the client.

What happens if you run the build again? Or if you open https://fonts.gstatic.com/s/opensans/v34/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk_RkWVAewA.woff2 in your browser?

I'll try to make these error messages more declarative and maybe create some retry functionality.

SeryiBaran commented 1 year ago

What happens if you run the build again?

Error occurs again

What happens if you run the build again? Or if you open https://fonts.gstatic.com/s/opensans/v34/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk_RkWVAewA.woff2 in your browser?

The browser downloads the file

SeryiBaran commented 1 year ago

Hmm, I'm restart build again and all works without errors 🤯

In any case, thanks for your response!

0xb4lint commented 1 year ago

It could be related to your network, your router, your ISP, or some IP restriction / traffic shaping from the server.

SeryiBaran commented 1 year ago

Maybe due to the fact that a lot of files are downloading in one time?

If you run build many times (it turns out that the fonts are downloaded in pieces), the error disappears

0xb4lint commented 1 year ago

That could be an issue! I'm working on some retry with a random waiting time downloading mechanism.

0xb4lint commented 1 year ago

@SeryiBaran could you please try out version 3.7.0-beta.0? it has some detailed logging and retry on error functionality

SeryiBaran commented 1 year ago

Fonts loads successfully after several attempts, thank you!

https://pastebin.com/T1KXuTdN