dx: less errors accessing frontend dev server
Massimo Melina committed
Apr 20, 2023 at 16:23 UTC
81135c7955ad9bbdc1d7031061919814f1207115
3 files changed
+3
-2
frontend/index.html
+1
@@ -5,6 +5,7 @@
5
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=0" />
6
<link href="/fontello.css" rel="stylesheet" />
7
<script type="module" src="/src/index.ts"></script>
8
+ <script>HFS={}</script>
9
</head>
10
<body>
11
<noscript>You need to enable JavaScript to run this app.</noscript>
frontend/src/components.ts
+1
-1
@@ -60,7 +60,7 @@ export function CustomCode({ name, props }: any) {
60
.map((x, key) => isValidElement(x) ? h(Fragment, { key }, x)
61
: typeof x === 'string' ? h(Html, { key, code: x })
62
: h('span', { key }, x))
63
- const html = getHFS().customHtml[name]
63
+ const html = getHFS().customHtml?.[name]
64
if (html?.trim?.())
65
ret.push(h(Html, { key: 'x', code: html }))
66
return ret
shared/index.ts
+1
-1
@@ -162,7 +162,7 @@ export function getHFS() {
162
}
163
164
export function getPrefixUrl() {
165
- return getHFS().prefixUrl
165
+ return getHFS().prefixUrl || ''
166
}
167
168
export function basename(path: string) {