Hello there,
I am playing with Hologram. I’ve set up a fresh Phoenix project and followed the Hologram installation guide.
I have created a main_layout.holo like this
<head>
<title>{@page_title}</title>
<Hologram.UI.Runtime />
</head>
<body>
<slot />
</body>
At this stage, compilation works.
Now, I want to load the app’s style sheet and copied the corresponding line from root.html.heex like so
<head>
<title>{@page_title}</title>
<Hologram.UI.Runtime />
<link phx-track-static rel="stylesheet" href={~p"/assets/css/app.css"} />
</head>
<body>
<slot />
</body>
However, now the compilation fails:
Compiling 1 file (.ex)
error: undefined function sigil_p/2 (expected HologramTutorial.MainLayout to define such a function or for it to be imported, but none are available)
│
4 │ prop :page_title, :string
│ ^^^^^^^^^^^^^^^^^^^^^^^^^
│
└─ (hologram_tutorial 0.1.0) app/layouts/main_layout.ex:4: HologramTutorial.MainLayout.template/0
== Compilation error in file app/layouts/main_layout.ex ==
** (CompileError) app/layouts/main_layout.ex: cannot compile module HologramTutorial.MainLayout (errors have been logged)
Removing the <link> line makes the compilation work again.
For reference, this is my main_layout.ex
defmodule HologramTutorial.MainLayout do
use Hologram.Component
prop :page_title, :string
end
What might be going on here?
Thank you!




















