Skip to content

Fix Pagefind search UI not rendering - #265

Merged
ohookins merged 1 commit into
mainfrom
fix/pagefind-search-ui
Aug 16, 2026
Merged

Fix Pagefind search UI not rendering#265
ohookins merged 1 commit into
mainfrom
fix/pagefind-search-ui

Conversation

@ohookins

Copy link
Copy Markdown
Owner

The search page from #264 doesn't render a search box because the dynamic import('/pagefind/pagefind-ui.js') is intercepted by webpack and fails silently.

This switches to the recommended Pagefind web component approach:

  • Loads pagefind-component-ui.js via a <script> tag (bypasses webpack entirely)
  • Uses <pagefind-searchbox> and <pagefind-results> web components
  • More reliable and the officially recommended pattern for Pagefind v1.5+

The dynamic import approach for pagefind-ui.js doesn't work
reliably with Gatsby's webpack bundling. Switch to loading
pagefind-component-ui.js via a script tag and using the
<pagefind-searchbox> and <pagefind-results> web components
instead.
@ohookins
ohookins force-pushed the fix/pagefind-search-ui branch from 99eb960 to 43c3036 Compare August 16, 2026 08:00
@ohookins
ohookins merged commit ff4f3d7 into main Aug 16, 2026
4 checks passed
@ohookins
ohookins deleted the fix/pagefind-search-ui branch August 16, 2026 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant