fix: silence pagefind warnings#15
Conversation
Greptile SummaryThis PR adds a one-line guard (
Confidence Score: 5/5Safe to merge — the change is a single-line early return with no logic side effects beyond disabling search in dev mode. The change is a one-liner that correctly gates pagefind loading on import.meta.env.PROD. The only follow-up is a stale inline comment in the catch block, which has no runtime impact. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[useEffect fires on mount] --> B{import.meta.env.PROD?}
B -- No --> C[Return early\nNo network request made]
B -- Yes --> D[Construct pagefind URL]
D --> E[Dynamic import pagefind.js]
E --> F{Import success?}
F -- Yes --> G[pf.init\npagefindRef.current = pf]
F -- No --> H[catch block\nsilently swallowed]
G --> I[Search available]
C --> J[pagefindRef stays null\nSearch shows no results]
|
Get rid of noisy pagefind warnings and 404s:
which came from the dev server looking for
/pagefind/pagefind.jswhen it didn't exist.