You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(build): search returns nothing over file:// (search.js fetches index at runtime) #471
The generated static site is documented as browsable directly from disk via file://, but static/js/search.js loads the search index with a runtime fetch(prefix + "/static/search-index.json") and ships no inline fallback. Stock Chromium and Firefox block fetch() between file:// resources (opaque file origins), so search silently returns nothing when the site is opened from disk. Browsing itself works — links are page-relative.
Repro
cook build
chromium --headless=new --dump-dom file:///abs/path/dist/index.html
# search over any term returns no results; console shows "Failed to fetch"
Reproduced on cookcli 0.34.0, with and without --base-url.
Scope
Search works fine over any HTTP host (deploy target, python -m http.server) and in browsers that permit local file fetch.
Only the file:// open-from-disk path is affected.
Suggested direction
Embedding the index inline (an inline <script> that assigns the JSON, or a JSONP-style loader) would restore file:// search without a network origin. Open to whatever approach you prefer — flagging before implementing in case there's a reason the index is kept external.
Done when
Search returns results when the generated site is opened via file://.
Activity
fix(build): emit search index as a script so file:// search works
test(e2e): cover static-site search over file://