phoenixframework / phoenix_live_reload

Provides live-reload functionality for Phoenix
MIT License
317 stars 90 forks source link

Fix unexpected quirks mode notification in Chrome #118

Closed createdbypete closed 3 years ago

createdbypete commented 3 years ago

Chrome (Version 94.0.4606.71 (Official Build) (x86_64)) is reporting an issue in dev tools due to missing DOCTYPE.

Screen Shot 2021-10-10 at 1 47 02 pm

The issue nor this suggested fix appears to impact live reload in anyway beyond removing the report in Chrome dev tools.

josevalim commented 3 years ago

:green_heart: :blue_heart: :purple_heart: :yellow_heart: :heart:

IgorCSilva commented 11 months ago

I'm receiving the same error.

When I access some file by controllers and inspect the page I see the \<!DOCTYPE html>, but using LiveView it doesn't appear.

mix.exs:

defp deps do
    [
      {:phoenix, "~> 1.5.0"},
      {:phoenix_pubsub, "~> 2.0"},
      {:phoenix_ecto, "~> 4.0"},
      {:ecto_sql, "~> 3.0"},
      {:postgrex, ">= 0.0.0"},
      {:phoenix_html, "~> 3.3"},
      {:phoenix_live_reload, "~> 1.2", only: :dev},
      {:gettext, "~> 0.11"},
      {:jason, "~> 1.0"},
      {:plug_cowboy, "~> 2.5"},
      {:hound, "~> 1.1.1"},
      {:phoenix_live_view, "~> 0.17.7"}
    ]
  end

LiveView file:

defmodule Sneakers23Web.TemperaturePageLive do
  use Phoenix.LiveView

  def render(assigns) do
    ~H"""
    Current temperature: <%= @temperature %>°F
    <button phx-click="inc_temperature">+</button>
    """
  end

  def mount(_params,  _session, socket) do
    socket = assign(socket, :temperature, 23)

    {:ok, socket}
  end
end

In Firefox: firefox-quirks-mode

In Chrome: chrome-quirks-mode