Elixir: ** (ArgumentError) could not fetch application environment [Plug.Static, :from] for application :softer because configuration at [Plug.Static, :from] was not set
(elixir 1.17.3) lib/application.ex:638: Application.compile_env!/3
lib/pillars/plug.ex:8: (module)
(elixir 1.17.3) lib/kernel/parallel_compiler.ex:429: anonymous fn/5 in Kernel.ParallelCompiler.spawn_workers/8
# Error here
defmodule Pillars.Plug do
use Plug.Router
if Mix.env() == :dev do
use Plug.Debugger, otp_app: :pillars
end
@external_resource Application.compile_env!(:softer, [Plug.Static, :from])
plug Plug.Static, Application.compile_env!(:softer, Plug.Static)
plug Plug.Parsers, Application.compile_env!(:softer, Plug.Parsers)
plug Plug.Session, Application.compile_env!(:softer, Plug.Session)
# ...
I’m getting this error from the code editor when [Plug.Static, :from]
works fine actually. I think it’s because config is config/build.exs
instead of config/config.exs
.
def project do
[
elixir: "~> 1.17",
build_path: umbrella("_build"),
config_path: umbrella("config/build.exs"),
# ...
]
end
The error disappears if I change it to config/config.exs
. Can I keep its name customised and make the error message gone?
- elixir-ls: stable 0.23.0
- Erlang/OTP 27
- Elixir 1.17.3 (compiled with Erlang/OTP 27)
- Zed 0.155.2