Programming Phoenix LiveView: P69 - module Pento.Catalog.Product is not available

In my terminal, I am trying this with the source code from the .zip (the repo where I was going from scratch also wasn’t working - similar error).
I suspect it’s a user error, but the files are there is reasonable stuff like defmodule Pento.Catalog.Product do. Maybe my Elixir install is bad?

C:\Users\me\pento_examples\generators\pento>iex
Interactive Elixir (1.14.1) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> ls
.formatter.exs     .gitignore         assets             config             lib
mix.exs            mix.lock           priv               test
iex(2)> alias Pento.Catalog.Product
Pento.Catalog.Product
iex(3)> exports Product
** (UndefinedFunctionError) function Pento.Catalog.Product.module_info/1 is undefined (module Pento.Catalog.Product is not available)
    Pento.Catalog.Product.module_info(:exports)
    (iex 1.14.1) lib/iex/autocomplete.ex:138: IEx.Autocomplete.exports/1
    (iex 1.14.1) lib/iex/helpers.ex:736: IEx.Helpers.exports/1
    iex:3: (file)
iex(3)> 

I tried Catalog too, and that got the same kind of error.

Even on page 45 I hit an issue:

iex(1)> alias Pento.Accounts
Pento.Accounts
iex(2)> export Accounts
** (CompileError) iex:2: undefined function export/1 (there is no such import)

I had a Google but couldn’t see an answer that looked like it’d work for me.
Any help would be really appreciated, so I can continue making progress with the book!

Hi there! You need to run an IEx session that loads up the application. So not iex but iex -S mix

1 Like

Ah thank you! :bowing_man:
I had a few months break before coming back to this book (short enough to remember roughly what’s going on, long enough to forget iex -S mix). The info is there in page 15. Hopefully google SEO will direct anyone with the same silly issue for this book to this thread :sweat_smile:. I thought it was kinda working because alias seemed happy enough to repeat the module names.