Hologram breaks tests: could not read file /_build/test/lib/hologram/priv/page_digest.plt": no such file or directory

I noticed when trying to run tests after installing hologram that I get the following error:

could not read file /_build/test/lib/hologram/priv/page_digest.plt": no such file or directory

I implemented a workaround that involves adding the creation of a stubbed page_digest file when using the mix test alias which does this:

  def create_hologram_stub(_args) do
    path = "_build/test/lib/hologram/priv"
    File.mkdir_p!(path)

    plt_file = Path.join(path, "page_digest.plt")

    unless File.exists?(plt_file) do
      File.write!(plt_file, :erlang.term_to_binary(%{}))
    end
  end

It solves the problem, but sure seems hacky. Is there a proper way to address this? Thanks!

1 Like

The page_digest.plt file is automatically generated every time the Hologram compiler runs, so this shouldn’t happen with a correct installation.

Could you create a GitHub repo that reproduces the problem? A fork of hologram_skeleton would work well for this. Without seeing the full setup, it’s hard to say what’s going wrong.

1 Like

Sorry for the super delayed response. I completely reinstalled Hologram and ran through the setup steps again. For whatever reason, this error has gone away :man_shrugging:. Not sure what caused this before but I’m glad that I don’t need my workaround anymore. Thanks!

1 Like