Skip to content

fix: only load Plausible analytics in production#2672

Merged
mroderick merged 1 commit into
masterfrom
fix/plausible-404-in-dev
Jun 29, 2026
Merged

fix: only load Plausible analytics in production#2672
mroderick merged 1 commit into
masterfrom
fix/plausible-404-in-dev

Conversation

@mroderick

Copy link
Copy Markdown
Collaborator

The Plausible script at /js/script.js is proxied through nginx in production (to bypass adblockers) but doesn't exist in development, causing a ActionController::RoutingError: No route matches [GET] "/js/script.js" on every page load.

Fix: wrap the script block in a Rails.env.production? guard so it only loads in production.

The Plausible script at /js/script.js is proxied through nginx
in production (bypasses adblockers), but doesn't exist in
development, causing a 404 on every page load.
@mroderick mroderick marked this pull request as ready for review June 25, 2026 18:41
@mroderick mroderick merged commit 711f3d9 into master Jun 29, 2026
25 of 26 checks passed
@mroderick mroderick deleted the fix/plausible-404-in-dev branch June 29, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants