plentico / plenti

Static Site Generator with Go backend and Svelte frontend
https://plenti.co
Apache License 2.0
985 stars 50 forks source link

Live Reload: Broken/Missing JS script? #306

Open MarioLiebisch opened 4 months ago

MarioLiebisch commented 4 months ago

I just initialized a --bare project and it's everything working fine, except it seems as if /spa/ejected/live-reload.js doesn't exist (nor is it generated or outputted). Instead there's a HTTP 302 redirect back to /:

Request:

GET /spa/ejected/live-reload.js HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: de,en;q=0.9,en-US;q=0.8
Cache-Control: no-cache
Connection: keep-alive
Cookie: session=<Random GUID>
DNT: 1
Host: localhost:3000
Pragma: no-cache
Referer: http://localhost:3000/
Sec-Fetch-Dest: script
Sec-Fetch-Mode: no-cors
Sec-Fetch-Site: same-origin
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
sec-ch-ua: "Not A(Brand";v="99", "Google Chrome";v="121", "Chromium";v="121"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"

Reply:

HTTP/1.1 302 Found
Content-Type: text/html; charset=utf-8
Location: http://localhost:3000//
Date: Mon, 19 Feb 2024 10:43:21 GMT
Content-Length: 46

Also note the extra / at the end!

Plenti runs inside a Docker image (golang:latest) installing Plenti with go install as ‌@latest.

EKliptus commented 3 months ago

Same issue for me... I am on windows wsl

jimafisk commented 2 months ago

Hi @MarioLiebisch and @EKliptus,

Sorry for the delay responding! There were a couple of issues breaking live-reload:

These issues should be fixed now! Can you try the new release (v0.6.37) and let me know if it's working better for you now? I also just want to note the current feature is a simple browser refresh and not hot module reloading, hope that's what you're looking for. Thanks for the bug report!