fix: __FRSH_BUILD_ID is not defined (#1207)

This could happen if the runtime/utils.ts coe was loaded
prior to server/constants.ts, because they had some shared state on
`globalThis`.

I have mitigated this by not relying on global state anymore.

Fixes #1191

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
This commit is contained in:
Luca Casonato
2023-05-30 10:46:44 +10:00
committed by GitHub
co-authored by Asher Gomez
parent 675036b33c
commit 87b087e358
10 changed files with 66 additions and 46 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
import { Head } from "$fresh/runtime.ts";
import { asset, Head } from "$fresh/runtime.ts";
import { Handlers, PageProps } from "$fresh/server.ts";
import { frontMatter, gfm } from "../../utils/markdown.ts";
@@ -61,7 +61,7 @@ export default function DocsPage(props: PageProps<Data>) {
<>
<Head>
<title>{props.data.page?.title ?? "Not Found"} | fresh docs</title>
<link rel="stylesheet" href={`/gfm.css?build=${__FRSH_BUILD_ID}`} />
<link rel="stylesheet" href={asset("/gfm.css")} />
{description && <meta name="description" content={description} />}
</Head>
<div class="flex flex-col min-h-screen">