kristoff-it / zine

Fast, Scalable, Flexible Static Site Generator (SSG)
https://zine-ssg.io
MIT License
631 stars 37 forks source link

Windows devserver hangs #83

Closed kristoff-it closed 2 weeks ago

kristoff-it commented 2 weeks ago

Running the dev webserver on windows on my machine (Win 10) causes the server to hang after the first change is detected.

Upon further investigation it was discovered that the file watcher code works correctly and that what hangs is writing to the browser's websocket client. The ws connection is used to communicate to any browser looking at the website that an asset must be reloaded.

Looking at a debugger we see that we just get stuck inside of a FileWrite call even if the client is connected.

Interestingly, the fact that a ws connection has been established (and that the browser can load the assets to do so in the first place) indicates that the connection is working and that it's just our watcher trying to write to it, that causes an error.

kristoff-it commented 2 weeks ago

Was reminded that this is a problem in how networking works for Zig on Windows, fixed in https://github.com/kristoff-it/zine/commit/2bcddc397f2dc90b2869eac93beabfe2edbc0cac