<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="319287" data-post-id="319287">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="peterhartman" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  peterhartman
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Another related issue I discovered recently that people landing here after a search might find is that if you introduce CORS protection by adding eg:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">plug(:put_secure_browser_headers, %{"content-security-policy" =&gt; "default-src 'self'"})
</code></pre>
<p>Then the heroicons are blocked if you are running on <code>localhost</code></p>
<p>My solution was to add <a href="https://github.com/whatyouhide/corsica" rel="noopener nofollow ugc">Corsica</a> to my project then swap the <code>:put_secure_browser_headers</code> plug for eg:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">plug Corsica, origins: ["https://foo.com", "http://localhost"]
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="319287" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/heroicon-defined-in-core-components-not-working/61182/22">Post #21</a>
	                </div>
	            </div>
              <div id="likers-container-319287" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="319287"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #21"></div>
  </section>
</div>
    <div class="postbit" id="319842" data-post-id="319842">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="tairosonloa" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/tairosonloa/120/33877_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  tairosonloa
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I had this exactly issue. Te problems was the</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">plug(:put_secure_browser_headers, %{"content-security-policy" =&gt; "default-src 'self'"})
</code></pre>
<p>Is there a way to correctly set CSP and make the heroicons work? Tried a lot of things already</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="319842" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/heroicon-defined-in-core-components-not-working/61182/23">Post #22</a>
	                </div>
	            </div>
              <div id="likers-container-319842" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="319842"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #22"></div>
  </section>
</div>
    <div class="postbit" id="319862" data-post-id="319862">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="slouchpie" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/slouchpie/120/34819_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  slouchpie
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Make your own CSP headers.</p>
<p>For example:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">    plug :put_secure_browser_headers, %{"content-security-policy" =&gt; MyAppWeb.CSP.header_value()}
</code></pre>
<p>with csp module like this:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule MyAppWeb.CSP do
  @moduledoc """
  Content-Security-Policy

  https://www.w3.org/TR/CSP2/#directives
  https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
  """

  @hcaptcha ["https://hcaptcha.com", "https://*.hcaptcha.com"]
  @stripe ["https://js.stripe.com"]
  @google_fonts ["https://fonts.googleapis.com"]
  @env_specific_csp if Mix.env() == :dev,
                      do: ["'unsafe-inline'", "'unsafe-eval'", "blob:", "http://localhost:4007"],
                      else: []

  @header_kvp_list [
    default_src: ["'self'"],
    img_src: ["'self'", "data:"] ++ @env_specific_csp,
    script_src: ["'self'"] ++ @hcaptcha ++ @stripe ++ @env_specific_csp,
    object_src: ["'self'"],
    frame_src: ["'self'"] ++ @hcaptcha ++ @stripe,
    style_src: ["'self'", "'unsafe-inline'"] ++ @hcaptcha ++ @stripe ++ @google_fonts ++ @env_specific_csp,
    connect_src: ["'self'"] ++ @hcaptcha ++ @stripe
  ]

  @spec header_value() :: String.t()
  def header_value do
    configured_header_kvp_list = Application.get_env(:my_app, :csp_headers, [])

    @header_kvp_list
    |&gt; Keyword.merge(configured_header_kvp_list)
    |&gt; Enum.map_join("; ", &amp;map_header_kvp_to_string/1)
  end

  defp map_header_kvp_to_string({atom_key, list_value}) do
    string_key = atom_key |&gt; to_string() |&gt; String.replace("_", "-")
    string_value = Enum.join(list_value, " ")
    "#{string_key} #{string_value}"
  end
end
</code></pre>
<p>That is lifted straight from one of my hobby projects. localhost:4007 is an imgproxy server.</p>
<p>Anyway, I think the thing that is needed is the google fonts bit? Not sure, but this solved heroicons for me in terms of CSP.</p>
<hr>
<p><strong>Edit 26 March 2024</strong>: read this instead: <a href="https://forum.elixirforum.com/t/blog-post-content-security-policy-header-with-phoenix-liveview/62486" class="inline-onebox" rel="nofollow">Blog Post: Content Security Policy header with Phoenix LiveView</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="319862" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/heroicon-defined-in-core-components-not-working/61182/24">Post #23</a>
	                </div>
	            </div>
              <div id="likers-container-319862" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="319862"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #23"></div>
  </section>
</div>
    <div class="postbit" id="319881" data-post-id="319881">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="tairosonloa" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/tairosonloa/120/33877_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  tairosonloa
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>What I actually needed was to update my plug like</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">plug(:put_secure_browser_headers, %{"content-security-policy" =&gt; "default-src 'self' data:"})
</code></pre>
<p>What I was not being able to find the correct value (it turned out to be <code>data:</code>). I finally got it by looking at <a class="mention" href="/u/slouchpie" rel="nofollow">@slouchpie</a> solution. That solution is currently a lot more of what I need, but it could be helpful for bigger projects or other people <img src="https://forum.elixirforum.com/images/emoji/apple/+1.png?v=15" title=":+1:" class="emoji" alt=":+1:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="319881" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/heroicon-defined-in-core-components-not-working/61182/25">Post #24</a>
	                </div>
	            </div>
              <div id="likers-container-319881" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="319881"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #24"></div>
  </section>
</div>
    <div class="postbit" id="320542" data-post-id="320542">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="peterhartman" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  peterhartman
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Am feeling embarrassed I confused CORS with CSP! Building on <a class="mention" href="/u/slouchpie" rel="nofollow">@slouchpie</a>’s solution I created a plug that sets the CSP for me and adds a nonce to the <code>assigns</code> so it can be used in various places.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule TvpNgWeb.CSP do
  @moduledoc """
  Content-Security-Policy

  With thanks to the authors of: 
  https://www.w3.org/TR/CSP2/#directives
  https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
  https://csp-evaluator.withgoogle.com/
  https://furlough.merecomplexities.com/elixir/phoenix/security/2021/02/26/content-security-policy-configuration-in-phoenix.html
  https://francis.chabouis.fr/posts/csp-nonce-with-phoenix/
  """
  def init(options), do: options

  defp generate_nonce(size \\ 10),
    do: size |&gt; :crypto.strong_rand_bytes() |&gt; Base.url_encode64(padding: false)

  def call(conn, _opts) do
    # a random string is generated
    nonce = generate_nonce()
    csp_headers = header_value(nonce)

    conn
    # the nonce is saved in the connection assigns
    |&gt; Plug.Conn.assign(:csp_nonce_value, nonce)
    |&gt; Phoenix.Controller.put_secure_browser_headers(%{"content-security-policy" =&gt; csp_headers})
  end

  @env_specific_csp (case Mix.env() do
                       :prod -&gt; []
                       _ -&gt; ["'unsafe-inline'"]
                     end)

  @header_kvp_list [
    img_src: ["'self'", "data:"] ++ @env_specific_csp,
    script_src: ["'strict-dynamic'", "NONCE"],
    object_src: ["'none'"],
    base_uri: ["'none'"],
    # require_trusted_types_for: ["'script'"] - See https://github.com/phoenixframework/phoenix_live_view/issues/3166
  ]

  defp header_value(nonce) do
    configured_header_kvp_list = Application.get_env(:tvp_ng, :csp_headers, [])

    @header_kvp_list
    |&gt; Keyword.merge(configured_header_kvp_list)
    |&gt; Enum.map_join("; ", &amp;map_header_kvp_to_string(nonce, &amp;1))
  end

  defp map_header_kvp_to_string(nonce, {atom_key, list_value}) do
    string_key = atom_key |&gt; to_string() |&gt; String.replace("_", "-")
    string_value = list_value |&gt; Enum.join(" ") |&gt; String.replace("NONCE", "'nonce-#{nonce}'")
    "#{string_key} #{string_value}"
  end
end
</code></pre>
<p>eg. phoenix_live_dashboard:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">live_dashboard("/dashboard", metrics: TvpNgWeb.Telemetry, csp_nonce_assign_key: :csp_nonce_value)
</code></pre>
<p>and root.html.heex</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">&lt;script defer phx-track-static nonce={@csp_nonce_value} type="text/javascript" src={~p"/assets/app.js"}&gt;
</code></pre>
<p>I found Google’s CSP Chrome plugin from to be super helpful with this -  <a href="https://csp-evaluator.withgoogle.com/" rel="noopener nofollow ugc">https://csp-evaluator.withgoogle.com/</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="320542" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/heroicon-defined-in-core-components-not-working/61182/26">Post #25</a>
	                </div>
	            </div>
              <div id="likers-container-320542" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="320542"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #25"></div>
  </section>
</div>
    <div class="postbit" id="320588" data-post-id="320588">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="slouchpie" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/slouchpie/120/34819_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  slouchpie
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>This is awesome! Thanks for sharing the code.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="320588" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/heroicon-defined-in-core-components-not-working/61182/27">Post #26</a>
	                </div>
	            </div>
              <div id="likers-container-320588" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="320588"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #26"></div>
  </section>
</div>
    <div class="postbit" id="320593" data-post-id="320593">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="tj0" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  tj0
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Just fyi, there are also items that should be added for backward compatibility. By default, for javascript, it should be using “strict-dynamic”. Any browser supporting that will use it, but if not, there should be a fallback.</p>
<p>This is from playing around with <a href="https://csp-evaluator.withgoogle.com/" rel="noopener nofollow ugc">https://csp-evaluator.withgoogle.com/</a></p>
<pre data-code-wrap="elixir"><code class="lang-elixir">      script-src 'self' 'unsafe-inline' https: 'nonce-#{nonce}' 'strict-dynamic';
</code></pre>
<p>I’ve also added HSTS headers and enabled feature-policy. There are some adjustments for safari. Note that feature-policy could break people using extensions on your website. I’m still running prod in report-only mode, but the following is the code.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">  defp generate_nonce(size \\ 10), do: size |&gt; :crypto.strong_rand_bytes() |&gt; Base.url_encode64(padding: false)
  @doc """

  Sets CSP, HSTS, and Feature/Permissions policies

  https://csp-evaluator.withgoogle.com/
  Consider adding 'unsafe-inline' (ignored by browsers supporting nonces/hashes) to be backward compatible with older browsers.
  https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src

  Need to add more than self for safari for connect-src
  https://github.com/w3c/webappsec-csp/issues/7
  https://bugs.webkit.org/show_bug.cgi?id=235873
  """
  def put_extra_secure_browser_headers(conn, _) do

    default_headers = %{
      "strict-transport-security" =&gt; "max-age=31536000; includeSubDomains",
      #"Permissions-Policy" =&gt; "geolocation=(self), microphone=(), camera=()",
      "feature-policy" =&gt; "geolocation 'self'; microphone 'none'; camera 'none';"
    }
    nonce = generate_nonce()

    # script-src 'self' 'nonce-#{nonce}' https://sandbox-checkout.paddle.com/ https://sandbox-cdn.paddle.com/ https://plausible.io/;
    csp_content = case Application.get_env(:your_app, :environment) do
                    :prod -&gt;
                      """
      report-uri /csp/report/;
      base-uri 'self';
      default-src 'self';
      script-src 'self' 'unsafe-inline' https: 'nonce-#{nonce}' 'strict-dynamic';
      frame-src 'self' https://subscription-management.paddle.com https://buy.paddle.com;
      style-src 'self' 'unsafe-inline' https://cdn.paddle.com/;
      img-src 'self' https://cdn.paddle.com/ blob: data:;
      object-src 'none';
      connect-src 'self' https://plausible.io/ wss://your.app ws://your.app;
      """
                      _ -&gt;
                      """
      report-uri /csp/report/;
      base-uri 'self';
      default-src 'self';
      script-src 'self' 'unsafe-inline' https: 'nonce-#{nonce}' 'strict-dynamic';
      frame-src 'self' https://sandbox-subscription-management.paddle.com https://sandbox-buy.paddle.com;
      style-src 'self' 'unsafe-inline' https://sandbox-cdn.paddle.com/;
      img-src 'self' https://cdn.paddle.com/ blob: data:;
      object-src 'none';
      connect-src 'self' https://plausible.io/ wss://test.your.app ws://test.your.app wss://localhost:* ws://localhost:*;
      """
    end

    csp_header = case Application.get_env(:hora, :environment)  do
      :prod -&gt; %{"content-security-policy-report-only" =&gt; csp_content |&gt; String.replace("\n", "")}
      _ -&gt; %{"content-security-policy" =&gt; csp_content |&gt; String.replace("\n", "")}
    end

    headers = Map.merge(default_headers, csp_header )

    Plug.Conn.merge_resp_headers(conn, headers)
    |&gt; assign(:csp_nonce, nonce)
    |&gt; Plug.Conn.put_session(:csp_nonce, nonce)
  end

</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="320593" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/heroicon-defined-in-core-components-not-working/61182/28">Post #27</a>
	                </div>
	            </div>
              <div id="likers-container-320593" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="320593"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #27"></div>
  </section>
</div>
    <div class="postbit" id="335556" data-post-id="335556">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="josefrichter" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josefrichter/120/19529_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  josefrichter
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I had some trouble with Heroicons not showing upon upgrading to Phoenix 1.7, and this was the last missing piece to be put into <code>tailwind.config.js</code>&gt;</p>
<pre data-code-wrap="js"><code class="lang-js">plugin(function ({ matchComponents, theme }) {
        let iconsDir = path.join(__dirname, "../deps/heroicons/optimized");
        let values = {};
        let icons = [
            ["", "/24/outline"],
            ["-solid", "/24/solid"],
            ["-mini", "/20/solid"],
            ["-micro", "/16/solid"],
        ];
        icons.forEach(([suffix, dir]) =&gt; {
            fs.readdirSync(path.join(iconsDir, dir)).forEach((file) =&gt; {
                let name = path.basename(file, ".svg") + suffix;
                values[name] = {
                    name,
                    fullPath: path.join(iconsDir, dir, file),
                };
            });
        });
        matchComponents(
            {
                hero: ({ name, fullPath }) =&gt; {
                    let content = fs
                        .readFileSync(fullPath)
                        .toString()
                        .replace(/\r?\n|\r/g, "");
                    let size = theme("spacing.6");
                    if (name.endsWith("-mini")) {
                        size = theme("spacing.5");
                    } else if (name.endsWith("-micro")) {
                        size = theme("spacing.4");
                    }
                    return {
                        [`--hero-${name}`]: `url('data:image/svg+xml;utf8,${content}')`,
                        "-webkit-mask": `var(--hero-${name})`,
                        mask: `var(--hero-${name})`,
                        "mask-repeat": "no-repeat",
                        "background-color": "currentColor",
                        "vertical-align": "middle",
                        display: "inline-block",
                        width: size,
                        height: size,
                    };
                },
            },
            { values }
        );
    })
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="335556" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/heroicon-defined-in-core-components-not-working/61182/29">Post #28</a>
	                </div>
	            </div>
              <div id="likers-container-335556" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="335556"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #28"></div>
  </section>
</div>
    <div class="postbit" id="343153" data-post-id="343153">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="marschro" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/marschro/120/23466_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  marschro
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I had a similar problem with latest greatest setup</p>
<ul>
<li>{:phoenix, “~&gt; 1.7.14”}</li>
<li>{:heroicons,<br>
github: “tailwindlabs/heroicons”,<br>
tag: “v2.1.5”,<br>
sparse: “optimized”,<br>
app: false,<br>
compile: false,<br>
depth: 1}</li>
</ul>
<p>I had the strange behaviors that only some icons worked, others not.<br>
The icons I used for longer in the project, where working fine… but creating an &lt;.icon /&gt; with a new name value did not work. The icon was just not rendered…</p>
<p>What solved this issue for me:</p>
<p>Whenever I add a new icon I have to manually run</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">mix phx.digest
</code></pre>
<p>Then restart the server and the icon appears…</p>
<p>Maybe that helps someone’s - don’t know, if that can be tackled in another way - but its okay to run the mix command from time to time…</p>
<p>I anyways start now my server with this command:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">source .env &amp;&amp; mix phx.digest &amp;&amp; iex -S mix phx.server
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="343153" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/heroicon-defined-in-core-components-not-working/61182/30">Post #29</a>
	                </div>
	            </div>
              <div id="likers-container-343153" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="343153"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #29"></div>
  </section>
</div>
    <div class="postbit" id="343185" data-post-id="343185">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Hermanverschooten" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Hermanverschooten/120/6447_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Hermanverschooten
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Are your regular tailwind classes working?<br>
I mean if you use one you hadn’t before?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="343185" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/heroicon-defined-in-core-components-not-working/61182/31">Post #30</a>
	                </div>
	            </div>
              <div id="likers-container-343185" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="343185"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #30"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/61182/load_more?page=4">Load more posts (18 remaining)</a>
</div></template></turbo-stream>