Skip to content

Commit f745edf

Browse files
committed
Fix static asset paths for GitHub Pages
- Update title-wave.png to use relative path - Fix DuckDB WASM and database file paths to include base path - Ensures all assets load correctly with /community-survey/ base path
1 parent c37206b commit f745edf

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

src/App.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ function App() {
661661
{/* Background Wave Image at Bottom */}
662662
<div className="absolute bottom-0 left-0 right-0 w-full">
663663
<img
664-
src="/title-wave.png"
664+
src="./title-wave.png"
665665
alt=""
666666
className="w-full h-auto object-cover object-bottom"
667667
/>

src/services/duckdb-wasm.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,15 @@ class DuckDBWasmService {
102102
// Use local DuckDB WASM files served by Vite instead of CDN
103103
// Build proper URLs that work both locally and through Tailscale
104104
const baseUrl = window.location.origin;
105+
const basePath = import.meta.env.DEV ? '' : '/community-survey';
105106
const MANUAL_BUNDLES = {
106107
mvp: {
107-
mainModule: `${baseUrl}/node_modules/@duckdb/duckdb-wasm/dist/duckdb-mvp.wasm`,
108-
mainWorker: `${baseUrl}/node_modules/@duckdb/duckdb-wasm/dist/duckdb-browser-mvp.worker.js`,
108+
mainModule: `${baseUrl}${basePath}/node_modules/@duckdb/duckdb-wasm/dist/duckdb-mvp.wasm`,
109+
mainWorker: `${baseUrl}${basePath}/node_modules/@duckdb/duckdb-wasm/dist/duckdb-browser-mvp.worker.js`,
109110
},
110111
eh: {
111-
mainModule: `${baseUrl}/node_modules/@duckdb/duckdb-wasm/dist/duckdb-eh.wasm`,
112-
mainWorker: `${baseUrl}/node_modules/@duckdb/duckdb-wasm/dist/duckdb-browser-eh.worker.js`,
112+
mainModule: `${baseUrl}${basePath}/node_modules/@duckdb/duckdb-wasm/dist/duckdb-eh.wasm`,
113+
mainWorker: `${baseUrl}${basePath}/node_modules/@duckdb/duckdb-wasm/dist/duckdb-browser-eh.worker.js`,
113114
},
114115
};
115116

@@ -176,7 +177,7 @@ class DuckDBWasmService {
176177

177178
// Load database file
178179
if (import.meta.env.DEV) console.log('📁 Fetching database file...');
179-
const response = await fetch('/node_red_survey.duckdb');
180+
const response = await fetch(`${basePath}/node_red_survey.duckdb`);
180181
if (!response.ok) {
181182
throw new Error(`Failed to fetch database file: ${response.status} ${response.statusText}`);
182183
}

0 commit comments

Comments
 (0)