Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

function CoherenceDemoWeb.Coherence.router/0 is undefined #339

Closed
ifsc01 opened this issue Apr 12, 2018 · 7 comments
Closed

function CoherenceDemoWeb.Coherence.router/0 is undefined #339

ifsc01 opened this issue Apr 12, 2018 · 7 comments

Comments

@ifsc01
Copy link

ifsc01 commented Apr 12, 2018

install mix coh.install --full
when run iex -S mix phx.server

Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]

Compiling 28 files (.ex)

== Compilation error in file lib/coherence_demo_web/router.ex ==
** (UndefinedFunctionError) function CoherenceDemoWeb.Coherence.router/0 is undefined or private
    CoherenceDemoWeb.Coherence.router()
    expanding macro: CoherenceDemoWeb.Coherence.__using__/1
    lib/coherence_demo_web/router.ex:2: CoherenceDemoWeb.Router (module)
    (elixir) expanding macro: Kernel.use/2
    lib/coherence_demo_web/router.ex:2: CoherenceDemoWeb.Router (module)
    (elixir) lib/kernel/parallel_compiler.ex:198: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/6

router.ex

defmodule CoherenceDemoWeb.Router do
  use CoherenceDemoWeb.Coherence, :router
  use Coherence.Router         # Add this

code demo:

https://github.com/zw0/coherence_demo

mix.exs https://github.com/zw0/coherence_demo/blob/master/mix.exs#L44

change router.ex

image

get Compilation error

== Compilation error in file lib/coherence_demo_web/coherence_messages.ex ==
** (ArgumentError) *gettext macros expect translation keys (msgid and msgid_plural) and
domains to expand to strings at compile-time, but the given msgid
doesn't.

Dynamic translations should be avoided as they limit gettext's
ability to extract translations from your source code. If you are
sure you need dynamic lookup, you can use the functions in the Gettext
module:

    string = "hello world"
    Gettext.gettext(CoherenceDemoWeb.Gettext, string)

    (gettext) lib/gettext/compiler.ex:231: Gettext.Compiler.expand_to_binary/4
    expanding macro: CoherenceDemoWeb.Gettext.dgettext_noop/2
    lib/coherence_demo_web/coherence_messages.ex:75: CoherenceDemoWeb.Coherence.Messages.you_are_using_an_invalid_security_token/0
    expanding macro: CoherenceDemoWeb.Gettext.dgettext/2
    lib/coherence_demo_web/coherence_messages.ex:75: CoherenceDemoWeb.Coherence.Messages.you_are_using_an_invalid_security_token/0
    (elixir) lib/kernel/parallel_compiler.ex:198: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/6
@StephanMeijer
Copy link

Same issue here ...

@StephanMeijer
Copy link

@zw0 On what Erlang/Elixir/Phoenix version are you working?

@StephanMeijer
Copy link

Maybe relevant; smpallen99/ex_admin#425

@StephanMeijer
Copy link

StephanMeijer commented Apr 22, 2018

Fixed: update gettext. See ticket of exadmin

@StephanMeijer
Copy link

Edit: Updating gettext seems not to solve the problem properly..

@StephanMeijer
Copy link

Final fix:

  1. Use gettext 0.13.1
  2. Change the routing reference, like you already did

@ryanhart2
Copy link

This issue should be closed.

It consists of two different issues, both of which have since been reported separately as #345 and #346

@ifsc01 ifsc01 closed this as completed May 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants