<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="85852" data-post-id="85852">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="chrismccord" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/chrismccord/120/24233_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  chrismccord
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Phoenix</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Phoenix 1.2 vs 1.3 isn’t a problem here. While we added <code>AppWeb</code> naming, it’s just a module name. What the elixir stack trace is telling us is that <code>AppChat.PrivateChannel</code> does not exist. From your provided snippets, the user socket <code>channel</code> matches the <code>defmodule AppChat.PrivateChannel</code>, but is it possible you renamed these in your example? Can you include your, <em>current</em>, <em>exact</em>, user_socket.ex and private_channel.ex, along with a current elixir stack trace? Thanks!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="85852" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/always-get-that-my-join-3-function-is-undefined-join-crash-what-am-i-missing/14796/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-85852" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="85852"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="85853" data-post-id="85853">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Deathslice246" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Deathslice246/120/10264_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Deathslice246
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Yep, I stopped and restarted the phoenix server to make sure all the files were compiled and up to date. I restarted my angularjs app, was able to connect to my user channel but not my private channel. Still says module is not available and join/3 undefined.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="85853" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/always-get-that-my-join-3-function-is-undefined-join-crash-what-am-i-missing/14796/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-85853" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="85853"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="85854" data-post-id="85854">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="NobbZ" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/NobbZ/120/27235_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  NobbZ
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>We need to find out why the module is unavailable before we try to delve into the undefined function. Well I do assume, that the undefined function is just a follow up of the missing module and will just work after we fixed the problem with the module.</p>
<p>Can you extract a minimal version that shows the problem and put it on github?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="85854" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/always-get-that-my-join-3-function-is-undefined-join-crash-what-am-i-missing/14796/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-85854" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="85854"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="85857" data-post-id="85857">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Deathslice246" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Deathslice246/120/10264_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Deathslice246
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>The 3 files you see there are exact. All I’ve been trying to do so far is to make sure that I can connect to these two channel before I can proceed to other stuff. About the elixir stack trace, I added the truncate: infinity option in the config.exs and ran phoenix like this: iex -S mix phoenix.server and the stack trace that I got in the console when trying to start a private chat was this:</p>
<pre><code>[info] JOIN private:3:3 to AppChat.PrivateChannel
  Transport:  Phoenix.Transports.WebSocket
  Parameters: %{}
[error] an exception was raised:
    ** (UndefinedFunctionError) function AppChat.PrivateChannel.join/3 is undefined (module AppChat.PrivateChannel is not available)
        AppChat.PrivateChannel.join("private:3:3", %{}, %Phoenix.Socket{assigns: %{current_user: %AppChat.User{__meta__: #Ecto.Schema.Metadata&lt;:loaded, "user_user"&gt;, date_joined: ~N[2018-05-22 02:04:54.000000], email: "testbot1@mail.com", first_name: "", id: 3, is_active: true, is_staff: false, is_superuser: true, last_login: ~N[2018-06-21 13:39:17.111225], last_name: "", password: "pbkdf2_sha256$30000$cisWeRJFh94O$jTspzHNklJr+WKd5q1iPTzLz++eW1plIUoI+3DoZJEI=", user_message: #Ecto.Association.NotLoaded&lt;association :user_message is not loaded&gt;, username: "testbot1@mail.com"}}, channel: AppChat.PrivateChannel, channel_pid: #PID&lt;0.391.0&gt;, endpoint: AppChat.Endpoint, handler: AppChat.UserSocket, id: "user_socket:3", joined: false, pubsub_server: AppChat.PubSub, ref: nil, serializer: Phoenix.Transports.WebSocketSerializer, topic: "private:3:3", transport: Phoenix.Transports.WebSocket, transport_name: :websocket, transport_pid: #PID&lt;0.388.0&gt;})
        (phoenix) lib/phoenix/channel/server.ex:170: Phoenix.Channel.Server.init/1
        (stdlib) gen_server.erl:365: :gen_server.init_it/2
        (stdlib) gen_server.erl:333: :gen_server.init_it/6
        (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
[info] Replied private:3:3 :error
</code></pre>
<p>Which is matches the stacktrace from my second post? Is this what you wanted?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="85857" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/always-get-that-my-join-3-function-is-undefined-join-crash-what-am-i-missing/14796/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-85857" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="85857"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="85860" data-post-id="85860">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Deathslice246" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Deathslice246/120/10264_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Deathslice246
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Here is something strange, If I start up elixir interactive and type AppChat.PrivateChannel, it finds the module. What does that tell you?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="85860" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/always-get-that-my-join-3-function-is-undefined-join-crash-what-am-i-missing/14796/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-85860" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="85860"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="85862" data-post-id="85862">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="chrismccord" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/chrismccord/120/24233_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  chrismccord
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Phoenix</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Something basic must be wrong here. If you can’t push your code to GitHub for us to look at, can you double check that you named your <code>AppChat.PrivateChannel</code> with “.ex” and not something like “.exs” ? If your code is as provided, then that’s the only obvious thing that could be going wrong. The error is a basic one to fix, we just need to find out why <code>AppChat.PrivateChannel</code> is undefined. If the code is as you claim, then the module isn’t being compiled for another reason, such as extension.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="85862" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/always-get-that-my-join-3-function-is-undefined-join-crash-what-am-i-missing/14796/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-85862" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="85862"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #16"></div>
  </section>
</div>
    <div class="postbit" id="85863" data-post-id="85863">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Deathslice246" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Deathslice246/120/10264_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Deathslice246
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Ok, I’ll make an example on github and post it here shortly.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="85863" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/always-get-that-my-join-3-function-is-undefined-join-crash-what-am-i-missing/14796/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-85863" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="85863"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #17"></div>
  </section>
</div>
    <div class="postbit" id="85878" data-post-id="85878">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Deathslice246" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Deathslice246/120/10264_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Deathslice246
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Yes I’m convince that it is something on the client side.</p>
<p>I changed my user_channel.ex to this:</p>
<pre><code>defmodule AppChat.UserChannel do
  use AppChat.Web, :channel

  def join("user:" &lt;&gt; user_id, _payload, socket) do
    if socket.assigns.current_user.id == String.to_integer(user_id) do
      {:ok, socket}
    else
      {:error, %{reason: "unauthorized"}}
    end
  end

  def join("private:" &lt;&gt; users_string, _payload, socket) do
    if users_string |&gt; String.split(":") |&gt; Enum.member?(to_string(socket.assigns.current_user.id)) do
      {:ok, %{}, socket}
    else
      {:error, %{reason: "unauthorized"}}
    end
  end
end
</code></pre>
<p>and my user_socket to this:</p>
<pre><code>defmodule AppChat.UserSocket do
  use Phoenix.Socket

  channel "user:*", AppChat.UserChannel
  channel "private:*", AppChat.UserChannel

  transport :websocket, Phoenix.Transports.WebSocket

  def connect(%{ "user_id" =&gt; id }, socket) do
    current_user = AppChat.Repo.get(AppChat.User, String.to_integer(id))
    {:ok, assign(socket, :current_user, current_user)}
  end

  def id(socket), do: "user_socket:#{socket.assigns.current_user.id}"
end
</code></pre>
<p>and when I do <strong>user:3</strong> it’s fine and says that it joined and when I do <strong>private:3:3</strong> or even <strong>private:3</strong> it says that UserChannel module is not available. So how it can say that a <strong>module is available in one instance</strong> and then the <strong>same module not available</strong> in another instance?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="85878" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/always-get-that-my-join-3-function-is-undefined-join-crash-what-am-i-missing/14796/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-85878" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="85878"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #18"></div>
  </section>
</div>
    <div class="postbit" id="85880" data-post-id="85880">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="NobbZ" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/NobbZ/120/27235_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  NobbZ
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<ol>
<li>Can you provide a minified project for us to reproduce the issue?</li>
<li>Are you able to reproduce the issue with phoenix 1.3?</li>
</ol> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="85880" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/always-get-that-my-join-3-function-is-undefined-join-crash-what-am-i-missing/14796/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-85880" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="85880"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #19"></div>
  </section>
</div>
    <div class="postbit" id="85882" data-post-id="85882">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="amnu3387" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  amnu3387
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Deathslice246" data-post="19" data-topic="14796">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/deathslice246/48/10264_2.png" class="avatar"> Deathslice246:</div>
<blockquote>
<p>{:ok, %{}, socket}</p>
</blockquote>
</aside>
<p>Can you try <code>{:ok, %{success: true}, socket} </code>?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="85882" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/always-get-that-my-join-3-function-is-undefined-join-crash-what-am-i-missing/14796/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-85882" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="85882"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #20"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/14796/load_more?page=3">Load more posts (2 remaining)</a>
</div></template></turbo-stream>