@checkstack/frontend 0.2.16 → 0.2.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/package.json +1 -1
- package/src/App.tsx +46 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# @checkstack/frontend
|
|
2
2
|
|
|
3
|
+
## 0.2.17
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0603d39: Fix onboarding flow not appearing on fresh Docker deployments (issue #79)
|
|
8
|
+
|
|
9
|
+
The `.env.example` had `BASE_URL` defaulting to `http://localhost:5173`
|
|
10
|
+
(the Vite dev server port). Users copying this file verbatim for a Docker
|
|
11
|
+
deployment would get a frontend that silently made all API calls to the
|
|
12
|
+
wrong origin, causing empty state and extreme sluggishness.
|
|
13
|
+
|
|
14
|
+
**Changes:**
|
|
15
|
+
|
|
16
|
+
- `.env.example`: Adds clear comments explaining the value must match the
|
|
17
|
+
container's exposed port.
|
|
18
|
+
- `frontend-api` (`RuntimeConfigProvider`): Removes the silent fallback when
|
|
19
|
+
`/api/config` returns an unreachable baseUrl — instead propagates the error
|
|
20
|
+
so it can be surfaced.
|
|
21
|
+
- `frontend` (`App.tsx`): Renders an actionable error screen when the backend
|
|
22
|
+
config cannot be loaded, showing the exact `BASE_URL` fix and the
|
|
23
|
+
`docker compose` command to recover.
|
|
24
|
+
- `docs/getting-started/docker.md`: Adds a dedicated troubleshooting section
|
|
25
|
+
for this exact misconfiguration.
|
|
26
|
+
|
|
27
|
+
- Updated dependencies [0603d39]
|
|
28
|
+
- @checkstack/frontend-api@0.3.7
|
|
29
|
+
- @checkstack/auth-frontend@0.5.12
|
|
30
|
+
- @checkstack/catalog-frontend@0.5.1
|
|
31
|
+
- @checkstack/command-frontend@0.2.15
|
|
32
|
+
- @checkstack/ui@1.1.2
|
|
33
|
+
|
|
3
34
|
## 0.2.16
|
|
4
35
|
|
|
5
36
|
### Patch Changes
|
package/package.json
CHANGED
package/src/App.tsx
CHANGED
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
RuntimeConfigProvider,
|
|
24
24
|
useRuntimeConfigLoading,
|
|
25
25
|
useRuntimeConfig,
|
|
26
|
+
useRuntimeConfigContext,
|
|
26
27
|
OrpcQueryProvider,
|
|
27
28
|
} from "@checkstack/frontend-api";
|
|
28
29
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
@@ -185,6 +186,8 @@ function AppContent() {
|
|
|
185
186
|
*/
|
|
186
187
|
function AppWithApis() {
|
|
187
188
|
const isConfigLoading = useRuntimeConfigLoading();
|
|
189
|
+
const { error: configError, config: runtimeConfig } =
|
|
190
|
+
useRuntimeConfigContext();
|
|
188
191
|
const { baseUrl } = useRuntimeConfig();
|
|
189
192
|
|
|
190
193
|
const apiRegistry = useMemo(() => {
|
|
@@ -220,7 +223,7 @@ function AppWithApis() {
|
|
|
220
223
|
return registryBuilder.build();
|
|
221
224
|
}, [baseUrl]);
|
|
222
225
|
|
|
223
|
-
// Show
|
|
226
|
+
// Show spinner while fetching runtime config and probing baseUrl.
|
|
224
227
|
if (isConfigLoading) {
|
|
225
228
|
return (
|
|
226
229
|
<div className="h-screen flex items-center justify-center bg-background">
|
|
@@ -229,6 +232,48 @@ function AppWithApis() {
|
|
|
229
232
|
);
|
|
230
233
|
}
|
|
231
234
|
|
|
235
|
+
// Config probe failed — baseUrl is not reachable (misconfigured BASE_URL).
|
|
236
|
+
// Surface a clear diagnostic rather than a broken empty dashboard.
|
|
237
|
+
if (!runtimeConfig || configError) {
|
|
238
|
+
return (
|
|
239
|
+
<div className="h-screen flex items-center justify-center bg-background p-8">
|
|
240
|
+
<div className="max-w-lg w-full rounded-xl border border-destructive/50 bg-destructive/10 p-8 space-y-4 text-center">
|
|
241
|
+
<div className="text-4xl">⚠️</div>
|
|
242
|
+
<h1 className="text-xl font-bold text-destructive">
|
|
243
|
+
Cannot connect to Checkstack backend
|
|
244
|
+
</h1>
|
|
245
|
+
<p className="text-sm text-muted-foreground">
|
|
246
|
+
The app loaded but its configured{" "}
|
|
247
|
+
<code className="bg-muted rounded px-1">BASE_URL</code> is not
|
|
248
|
+
reachable. Make sure it matches the URL + port your container or
|
|
249
|
+
reverse proxy exposes.
|
|
250
|
+
</p>
|
|
251
|
+
<div className="text-left bg-muted rounded-lg p-4 space-y-1 text-sm font-mono">
|
|
252
|
+
<p className="text-muted-foreground">
|
|
253
|
+
# For a default Docker setup:
|
|
254
|
+
</p>
|
|
255
|
+
<p className="text-foreground">BASE_URL=http://localhost:3000</p>
|
|
256
|
+
</div>
|
|
257
|
+
<p className="text-sm text-muted-foreground">
|
|
258
|
+
After updating your{" "}
|
|
259
|
+
<code className="bg-muted rounded px-1">.env</code>, recreate the
|
|
260
|
+
container:
|
|
261
|
+
</p>
|
|
262
|
+
<div className="text-left bg-muted rounded-lg p-4 text-sm font-mono">
|
|
263
|
+
<p className="text-foreground">
|
|
264
|
+
docker compose up -d --force-recreate
|
|
265
|
+
</p>
|
|
266
|
+
</div>
|
|
267
|
+
{configError && (
|
|
268
|
+
<p className="text-xs text-destructive/70 break-all">
|
|
269
|
+
{configError.message}
|
|
270
|
+
</p>
|
|
271
|
+
)}
|
|
272
|
+
</div>
|
|
273
|
+
</div>
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
|
|
232
277
|
return (
|
|
233
278
|
<QueryClientProvider client={queryClient}>
|
|
234
279
|
<ApiProvider registry={apiRegistry}>
|