1
votes

I am trying to migrate my Phoenix app from 1.2 to 1.3 using the official guide, including moving the web code into lib/my_app_web.

I am hitting the following

== Compilation error on file lib/my_app_web/gettext.ex ==
** (ArgumentError) unknown application: :MyAppWeb
    (elixir) lib/application.ex:428: Application.app_dir/1
    (elixir) lib/application.ex:437: Application.app_dir/2
    (gettext) expanding macro: Gettext.Compiler.__before_compile__/1
    lib/my_app_web/gettext.ex:1: MyAppWeb.Gettext (module)
    (elixir) lib/kernel/parallel_compiler.ex:117: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/1

in lib/my_app_web.ex I define defmodule MyAppWeb do ... end

Is there something else I need to update?

1
You probably need to pass the name of the application which is :my_app_web most likely.Dogbert
thanks, where is that passed?henry.oswald
Is there an instance of :MyAppWeb in lib/my_app_web/gettext.ex? Try changing that to :my_app_web.Dogbert

1 Answers

0
votes

Recent I came across this error. But not totally the same with you: I need to read some static file after compiled, so I use the Application.app_dir(:my_app, "priv/cert") to get the static file path in compiled release. But I find the error when compiled:

** (ArgumentError) unknown application: :my_app

Finally I find this error caused by the reason that I put Application.app_dir(:my_app, "priv/cert") in the config/dev.exs. When mix reading the config file, the :my_app still not exist. So this error occured.