eeue56 / elm-blogger

A blogging platform written in Elm + Elixir
BSD 3-Clause "New" or "Revised" License
102 stars 12 forks source link

"new_msg" has not yet been defined #19

Open et opened 8 years ago

et commented 8 years ago

I've followed all the instructions on the README and received this error when trying to start up phoenix.

$ mix phoenix.server
Compiling 13 files (.ex)
web/channels/editor_channel.ex:15: [warning] An intercept for event "new_msg" has not yet been defined in Elixir.ElmBlogger.EditorChannel.handle_out/3. Add "new_msg" to your list of intercepted events with intercept/1
== Compilation error on file web/router.ex ==
** (CompileError) web/router.ex: internal error in v3_core;
crash reason: {case_clause,
    {'EXIT',
        {badarg,
            [{erl_anno,anno_info,[-1],[{file,"erl_anno.erl"},{line,360}]},
             {v3_core,record_anno,2,[{file,"v3_core.erl"},{line,2410}]},
             {v3_core,expr,2,[{file,"v3_core.erl"},{line,539}]},
             {v3_core,safe,2,[{file,"v3_core.erl"},{line,1593}]},
             {v3_core,expr,2,[{file,"v3_core.erl"},{line,528}]},
             {v3_core,safe,2,[{file,"v3_core.erl"},{line,1593}]},
             {v3_core,'-safe_list/2-anonymous-0-',2,
                 [{file,"v3_core.erl"},{line,1608}]},
             {lists,foldr,3,[{file,"lists.erl"},{line,1276}]},
             {v3_core,expr,2,[{file,"v3_core.erl"},{line,538}]},
             {v3_core,safe,2,[{file,"v3_core.erl"},{line,1593}]},
             {v3_core,'-safe_list/2-anonymous-0-',2,
                 [{file,"v3_core.erl"},{line,1608}]},
             {lists,foldr,3,[{file,"lists.erl"},{line,1276}]},
             {v3_core,expr,2,[{file,"v3_core.erl"},{line,538}]},
             {v3_core,safe,2,[{file,"v3_core.erl"},{line,1593}]},
             {v3_core,expr,2,[{file,"v3_core.erl"},{line,528}]},
             {v3_core,safe,2,[{file,"v3_core.erl"},{line,1593}]},
             {v3_core,'-safe_list/2-anonymous-0-',2,
                 [{file,"v3_core.erl"},{line,1608}]},
             {lists,foldr,3,[{file,"lists.erl"},{line,1276}]},
             {v3_core,expr,2,[{file,"v3_core.erl"},{line,652}]},
             {v3_core,exprs,2,[{file,"v3_core.erl"},{line,512}]}]}}}

  in function  compile:'-select_passes/2-anonymous-2-'/2 (compile.erl, line 530)
  in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 315)
  in call from compile:fold_comp/3 (compile.erl, line 341)
  in call from compile:internal_comp/4 (compile.erl, line 325)
  in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line 175)
    (stdlib) lists.erl:1338: :lists.foreach/2
    (phoenix) expanding macro: Phoenix.Router.__before_compile__/1
    web/router.ex:1: ElmBlogger.Router (module)
    (elixir) lib/kernel/parallel_compiler.ex:116: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/1
elkelk commented 7 years ago

The Phoenix 1.2.1 changelog states:

[Channel] handle_out callbacks now require explicit event intercept for callback to be invoked, with Phoenix.Channel.intercept/1

If you add intercept(["new_msg"]) at the top of the channel module in question it should fix the problem.

et commented 7 years ago

@elkelk - Shouldn't this be locked to 1.1.4?

elkelk commented 7 years ago

Yeah, sorry. To be clear it is in the CHANGELOG for v0.15.0, so the solution still applies. https://github.com/phoenixframework/phoenix/blob/master/CHANGELOG.md#v0150-2015-7-27