[NA] [FE] fix: bypass manifest fetch in dev mode for hot reload#6110
[NA] [FE] fix: bypass manifest fetch in dev mode for hot reload#6110
Conversation
In dev mode, skip the manifest fetch entirely and use static asset paths without content hashes, so Vite hot reload works correctly for the assistant sidebar.
📋 PR Linter Failed❌ Invalid Title Format. Your PR title must include a ticket/issue number and may optionally include component tags (
Example: ❌ Missing Section. The description is missing the ❌ Missing Section. The description is missing the ❌ Missing Section. The description is missing the ❌ Missing Section. The description is missing the ❌ Missing Section. The description is missing the |
| enabled: !IS_DEV && !!manifestUrl, | ||
| staleTime: Infinity, | ||
| retry: 1, | ||
| }); | ||
|
|
There was a problem hiding this comment.
useQuery is gated by enabled: !IS_DEV && !!manifestUrl so in dev with VITE_ASSISTANT_SIDEBAR_BASE_URL unset the backend-resolved manifestUrl isn't fetched and DEV_META isn't returned — should we fetch the manifest in dev when manifestUrl exists or always return the dev fallback?
Finding type: Logical Bugs | Severity: 🟠 Medium
Want Baz to fix this for you? Activate Fixer
Other fix methods
Prompt for AI Agents:
Before applying, verify this suggestion against the current code. In
apps/opik-frontend/src/plugins/comet/AssistantSidebar.tsx around lines 284 to 288, the
useQuery is currently gated by enabled: !IS_DEV && !!manifestUrl which prevents fetching
the manifest in dev and causes meta to remain null. Change the enabled flag to enabled:
!!manifestUrl (i.e. allow the query to run whenever a manifestUrl exists, including in
dev) and keep the existing early-return of DEV_META when IS_DEV && DEV_BASE_URL. Ensure
manifestUrl is still checked before calling fetch (manifestUrl!) so no runtime null
dereference occurs.
There was a problem hiding this comment.
Commit 84bbdaa addressed this comment by changing the hook to only disable the manifest fetch when running in dev with DEV_BASE_URL and adding an explicit DEV_META early return, while keeping the query enabled whenever a manifestUrl exists so dev runs still fetch the backend manifest.
📋 PR Linter Failed❌ Invalid Title Format. Your PR title must include a ticket/issue number and may optionally include component tags (
Example: ❌ Missing Section. The description is missing the ❌ Missing Section. The description is missing the ❌ Missing Section. The description is missing the ❌ Missing Section. The description is missing the ❌ Missing Section. The description is missing the |
Only skip the manifest query when both IS_DEV and DEV_BASE_URL are true. Without DEV_BASE_URL the backend-resolved manifest should still be fetched so the sidebar loads normally in dev.
Details
In dev mode, skip the manifest fetch entirely and return a static
DEV_METAwith hashless asset paths (/assistant/assistant.js,/assistant/assistant.css). This disables the react-query manifest fetch whenIS_DEVis true and removes the dev-mode special case forshellUrlinside the query transform.Unblocks Vite hot reload for the Ollie assistant sidebar during local development.
Change checklist
Issues
NA
Testing
Documentation
No documentation changes needed.