mhanberg / advent-of-code-elixir-starter

Template project for Advent of Code in Elixir.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Config is not loaded

SOF3 opened this issue · comments

Using the default code, even if I uncomment the allow_network?: true line in config.exs or by creating secrets.exs, mix d01.p1 still errors:

$ mix d01.p1
Compiling 1 file (.ex)
** (RuntimeError) Cache miss for day 1 of year 2020 and `:allow_network?` is not `true`
    lib/advent_of_code/input.ex:28: AdventOfCode.Input.get!/2
    lib/mix/tasks/d01.p1.ex:8: Mix.Tasks.D01.P1.run/1
    (mix) lib/mix/task.ex:331: Mix.Task.run_task/3
    (mix) lib/mix/cli.ex:79: Mix.CLI.run_task/2

Can you try copying this file from my advent of code repo and seeing if that works? if it does feel free to replace the file in this repo with that file and open a PR (I can do that if you don't want to do it 😄).

https://github.com/mhanberg/advent-of-code/blob/main/2020/lib/advent_of_code/input.ex

that seems to be already what I'm using. Or are there any differences?

I ran into this issue. I had forgotten to include use Mix.Config at the top of my config/secrets.exs file. It was failing silently without it.