image path changes, for dev setup, needs testing on 'prod' #1
Closed
nathan
wants to merge 3 commits from
image-path-changes into lotus
pull from: image-path-changes
merge into: :lotus
:lotus
:update-packages
:sw-fix
:read-me-update
:image-path-changes
:dm-calls
:fix-2469
:renovate/element-hq-element-call-embedded-0.x
:renovate/npm-i18next-http-backend-vulnerability
:renovate/npm-vite-vulnerability
:dev
:docs-update
:more-theme
:fix-257
:imporve-thread-reply
:revert-2402-improve-menu-congestion
:mxidColor-toggle
:update-sw-main-msg
Labels
Clear labels
a11y
area: appearance
area: auth-session
area: build-ci
area: calls
area: desktop
area: media
area: messaging
area: mobile
area: moderation
area: navigation
area: notifications
area: settings
area: threads
bug
dependencies
docs
duplicate
enhancement
help wanted
invalid
needs-human-review
performance
planning
priority: critical
priority: high
priority: low
priority: medium
qa
question
research
security
tech-debt
ux
wontfix
Accessibility: keyboard, screen reader, contrast, motion
Client area: appearance
Client area: auth-session
Client area: build-ci
Client area: calls
Client area: desktop
Client area: media
Client area: messaging
Client area: mobile
Client area: moderation
Client area: navigation
Client area: notifications
Client area: settings
Client area: threads
Something is not working
Third-party package versions and advisories
README / LOTUS_* docs wrong or missing
This issue or pull request already exists
New feature
Need some help
Something is wrong
Re-render storms, leaks, heavy work on hot paths
Data loss, security hole, or crash on a main path
Broken feature or serious usability problem
Minor issue or polish
Wrong behaviour in an edge case or notable degradation
Manual QA: shipped, needs a human in a real environment
More information is needed
XSS, unsafe URLs, data leaks, auth/session
Code health, dead code, fragile patterns
Usability or visual inconsistency
This won't be fixed
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: LotusGuild/cinny#1
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Test this with your prod build to make sure it didnt break anything there
Re-reviewed at the current head (
0aef410f) — thanks for cleaning up the formatting/lint in the last two commits; prettier and eslint both pass on the changed files now. 👍One substantive blocker remains: it still 404s the logo + favicon in production.
The URLs resolve to the site root (/Lotus.png, /lotus.png, …), but the build sets copyPublicDir: false, so Vite never emits publicDir into dist/ — the logos reach dist/ only via vite-plugin-static-copy,
which lands them at dist/public/res/. I verified with an actual build of this branch's config: dist/Lotus.png (and the three favicons) are absent → 404, while dist/public/res/Lotus.png exists. Dev works
only because publicDir: './public/res' serves that folder at the root in the dev server — that remap doesn't exist in the built output.
Fix: point the paths at /public/res/… and revert the vite.config.js change (leave publicDir: false). Resolves in both dev and prod with no config change:
const LotusLogo = withOriginBaseUrl(getOriginBaseUrl(), '/public/res/Lotus.png');
(Keeping publicDir: './public/res' would also require copyPublicDir: true, which double-copies all of public/res — android/apple/svg, ~560K — into the dist root when only the 4 logos are used there. Not
recommended.)
Heads-up: lotus already shipped this exact fix in
f12e05c5using /public/res/…, so closing/rebasing may be simpler than reworking.Closing this in favor of the version now on lotus (
f2c356f2) — I took your approach here (the withOriginBaseUrl(getOriginBaseUrl(), …) helper) and landed it there, co-authored to you. 🙌The only change from this PR: the paths point at /public/res/… instead of the site root, and vite.config.js stays publicDir: false. Reason — the prod build sets copyPublicDir: false, so a root /Lotus.png
404s in production (the logos are emitted to dist/public/res/ by vite-plugin-static-copy); verified with a build. Same helper, same idea, just the prod-safe path.
Thanks for chasing the root cause here — the public/ import diagnosis was spot on. Closing as merged-in-spirit.
Pull request closed