Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix: serve frontend/public over /static in dev so runtime asset paths resolve (#76928)

Javier Bahamondese2a737f29a4d
diff --git a/posthog/settings/web.py b/posthog/settings/web.py
index 2de7e99ca8f9..f08b0cc5705c 100644
--- a/posthog/settings/web.py
+++ b/posthog/settings/web.py
@@ -417,6 +417,18 @@ STATIC_URL = "/static/"
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "frontend/dist"),
]
+if DEBUG:
+ # Vite copies frontend/public into dist only on a production build, so in dev
+ # nothing serves `/static/services/*`. Those paths aren't bundler imports — they
+ # arrive as strings in API payloads (warehouse source `iconPath`, CDP destination
+ # `icon_url`), so the bundler never sees them and can't rewrite them. The request
+ # falls through to the SPA catch-all, the <img> is handed HTML, and every one of
+ # those logos silently swaps to its error placeholder.
+ #
+ # DEBUG-only on purpose: in production dist already holds these files, and adding
+ # a second source for 1300+ identical assets would make collectstatic warn about
+ # duplicate destinations for no gain.
+ STATICFILES_DIRS.append(os.path.join(BASE_DIR, "frontend/public"))
STORAGES = {
"default": {
"BACKEND": "django.core.files.storage.FileSystemStorage",