1.1 KiB
1.1 KiB
Fix Draft Card Images
Issue
Users reported that images were not showing in the Draft Card Selection UI.
Root Causes
- Missing Proxy: The application was attempting to load cached images from
http://localhost:5173/cards/.... Vite Dev Server (port 5173) was not configured to proxy these requests to the backend (port 3000), resulting in 404 errors for all local images. - Incorrect Property Access:
DraftView.tsx(andDeckBuilderView.tsx) attempted to accesscard.image_uris.normal. However, theDraftCardobject generated byPackGeneratorServiceand modified byLobbyManagerstores the image URL incard.image. This property was being ignored.
Fixes
- Vite Config: Added a proxy rule for
/cardsinsrc/vite.config.tsto forward requests tohttp://localhost:3000. - Frontend Views: Updated
DraftView.tsxandDeckBuilderView.tsxto prioritizecard.imagewhen rendering card images.
Verification
- Start the draft.
- Images should now load correctly from the local cache (or fallback if configured).
- Inspect network tab to verify images are loaded from
/cards/...with a 200 OK status.