Skip to content

Commit 1cd6b71

Browse files
authored
Enable raise_on_missing_only in development (#6495)
Configure Plug.Static with raise_on_missing_only: code_reloading?() to help developers catch missing entries in static_paths() during development. This prevents the common trap where files like favicon.svg return 404 because they aren't properly declared in the :only list (often because they digested paths). Closes #6203
1 parent 8046111 commit 1cd6b71

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

installer/templates/phx_web/endpoint.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ defmodule <%= @endpoint_module %> do
2424
at: "/",
2525
from: :<%= @web_app_name %>,
2626
gzip: not code_reloading?,
27-
only: <%= @web_namespace %>.static_paths()
27+
only: <%= @web_namespace %>.static_paths(),
28+
raise_on_missing_only: code_reloading?
2829

2930
# Code reloading can be explicitly enabled under the
3031
# :code_reloader configuration of your endpoint.

0 commit comments

Comments
 (0)