diff --git a/src/main/scala/server/Server.scala b/src/main/scala/server/Server.scala index fa985e7..44ac37d 100644 --- a/src/main/scala/server/Server.scala +++ b/src/main/scala/server/Server.scala @@ -211,6 +211,11 @@ class Server(postgresService: PostgresService, dataService: DataService, fetch: // real, observed on /faktiska and /udens-temperatura in production. private val assets = staticcontent.fileService[IO](FileService.Config("./web/dist")) private val spaFallback = HttpRoutes.of[IO] { + // A missing file under /assets (the only place Vite emits hashed build + // output) should stay a real 404, not silently serve HTML — otherwise a + // stale tab referencing a since-removed bundle after a future deploy + // would get a confusing "unexpected token" JS parse error instead. + case GET -> Root / "assets" / _ => NotFound() case req @ GET -> _ => StaticFile.fromPath(Path("./web/dist/index.html"), Some(req)).getOrElseF(NotFound()) }