Alex-Njoroge

Alex-Njoroge

Phoenix liveview import not working: error: module Phoenix.LiveView.HTML is not loaded and could not be found

Hello everyone I have an issue.

I am creating a simple blogapp with a minimal frontend in phoenix liveview but I keep getting this error in my layouts.ex file.

mix compile
Compiling 3 files (.ex)
error: module Phoenix.LiveView.HTML is not loaded and could not be found
  lib/blogapp_web/components/layouts.ex:8: BlogappWeb.Layouts (module)


== Compilation error in file lib/blogapp_web/components/layouts.ex ==
** (CompileError) lib/blogapp_web/components/layouts.ex: cannot compile module BlogappWeb.Layouts (errors have been logged)

This is how my layouts.ex file looks like

defmodule BlogappWeb.Layouts do
  @moduledoc """
  This module holds different layouts used by your application.
  """

  use BlogappWeb, :html
  import Phoenix.HTML
  import Phoenix.LiveView.HTML  -( The error occurs in this line - module Phoenix.LiveView.HTML is not loaded and could not be found. This may be happening because the module you are trying to load directly or indirectly depends on the current module)

  embed_templates "layouts/*"
end

You help is deeply appreciated.

First Post!

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Hi @Alex-Njoroge to answer this sort of question we need some basic information:

  1. Can you provide the output of mix deps|grep phoenix, we need to know which versions of Phoenix and Phoenix LiveView are you running.
  2. How did you make the application?

Where Next?

Popular in Questions Top

chokchit
** (DBConnection.ConnectionError) connection not available and request was dropped from queue after 2733ms. You can configure how long re...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
Kurisu
For example for a current url like http://localhost:4000/cosmetic/products?_utf8=✓&query=perfume&page=2, I would like to get: ...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New

Other popular topics Top

dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement