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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Just to be clear: a failure when redefining a module is intended behaviour since Livebook 0.8.0 (see the <a href="https://github.com/livebook-dev/livebook/blob/main/CHANGELOG.md#v080-2022-12-08" rel="noopener nofollow ugc">changelog</a> about “Improved reproducibility of module definitions”). That’s what you’re seeing. You previously were running on an older version of Livebook that was ok with redefining modules (with the problem of not being fully reproducible, as José mentioned) which is why you had no problems back then. Nothing in Elixir itself changed in any way, regarding this. Livebook is more restrictive to make sure all livebooks are reproducible (run in the same way, no matter in which order you execute the cells). Regular Elixir allows you to redefine modules (it emits a warning if you do) afaik.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="291339" 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/how-do-i-redifine-modules-in-livebook/56442/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-291339" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="291339"
                     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="291341" data-post-id="291341">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="linusdm" data-post="10" data-topic="56442">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/linusdm/48/30659_2.png" class="avatar"> linusdm:</div>
<blockquote>
<p>For tutorials where there is a need to redefine a module over and over to evolve it over time, the only requirement is that the current cell, and all subsequent cells see the new module definition</p>
</blockquote>
</aside>
<p>That’s exactly the issue. Module names are global, so how can you make <em>only</em> subsequent cells see a given module definition? Even if you say: “well, we will purge and swap module versions before execution”, you can still have long-running processes and other functionality that will now be swapping modules on the fly.</p>
<p>Redefining a module is global mutable state and, if you want reproducible notebooks, then it won’t work.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="291341" data-batch-url="/posts/batch_likers">
                        3
                      </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/how-do-i-redifine-modules-in-livebook/56442/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-291341" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="291341"
                     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="291344" data-post-id="291344">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Ah yes, now I see where my thinking was not correct. I totally forgot about the concurrent aspects of running Elixir code <img src="https://forum.elixirforum.com/images/emoji/apple/face_with_peeking_eye.png?v=15" title=":face_with_peeking_eye:" class="emoji" alt=":face_with_peeking_eye:" loading="lazy" width="20" height="20">.<br>
There would indeed be no way to make such a system behave consistent. Thanks for clarifying!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="291344" 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/how-do-i-redifine-modules-in-livebook/56442/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-291344" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="291344"
                     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="291402" data-post-id="291402">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="vgrechin" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/vgrechin/120/26214_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  vgrechin
                    <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>Thank you very, <a class="mention" href="/u/linusdm" rel="nofollow">@linusdm</a> for the detailed explanation of Livebook internals, but still can not observe evidence of the regression occurred in 0.8.0. When I tried to build 0.7.2 with Elixir 1.15-rc.2 just encountered a severe run-time error:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">00:44:12.714 [error] #PID&lt;0.521.0&gt; running LivebookWeb.Endpoint (connection #PID&lt;0.520.0&gt;, stream id 1) terminated
Server: livebook.sleipner.ru:80 (http)
Request: GET /
** (exit) an exception was raised:
    ** (FunctionClauseError) no function clause matching in Livebook.Hubs.to_struct/1
        (livebook 0.7.2) lib/livebook/hubs.ex:104: Livebook.Hubs.to_struct(%{hub_emoji: "🏠", hub_name: "My Hub", id: "personal-hub", secret_key: "4oB-wLUGbX8SbVcfb6gzG4q4-8wSmmPvXOXmS7y2_wdMiyvSy9IDPr-83n2L7Dh28J2V_uDljhFjVtQ_v46fdw"})
        (elixir 1.15.0-rc.2) lib/enum.ex:1693: Enum."-map/2-lists^map/1-1-"/2
        (livebook 0.7.2) lib/livebook/hubs.ex:24: Livebook.Hubs.fetch_metadatas/0
        (livebook 0.7.2) lib/livebook_web/live/hooks/sidebar_hook.ex:12: LivebookWeb.SidebarHook.on_mount/4
        (phoenix_live_view 0.18.2) lib/phoenix_live_view/lifecycle.ex:148: anonymous fn/4 in Phoenix.LiveView.Lifecycle.mount/3
        (phoenix_live_view 0.18.2) lib/phoenix_live_view/lifecycle.ex:183: Phoenix.LiveView.Lifecycle.reduce_socket/3
        (phoenix_live_view 0.18.2) lib/phoenix_live_view/utils.ex:319: anonymous fn/6 in Phoenix.LiveView.Utils.maybe_call_live_view_mount!/5
        (telemetry 1.2.1) /tmp/mix-local-installer-fetcher-U5e5yQ/deps/telemetry/src/telemetry.erl:321: :telemetry.span/3
00:44:17.180 [error] #PID&lt;0.527.0&gt; running LivebookWeb.Endpoint (connection #PID&lt;0.526.0&gt;, stream id 1) terminated
Server: livebook.sleipner.ru:80 (http)
Request: GET /
** (exit) an exception was raised:
    ** (FunctionClauseError) no function clause matching in Livebook.Hubs.to_struct/1
        (livebook 0.7.2) lib/livebook/hubs.ex:104: Livebook.Hubs.to_struct(%{hub_emoji: "🏠", hub_name: "My Hub", id: "personal-hub", secret_key: "4oB-wLUGbX8SbVcfb6gzG4q4-8wSmmPvXOXmS7y2_wdMiyvSy9IDPr-83n2L7Dh28J2V_uDljhFjVtQ_v46fdw"})
        (elixir 1.15.0-rc.2) lib/enum.ex:1693: Enum."-map/2-lists^map/1-1-"/2
        (livebook 0.7.2) lib/livebook/hubs.ex:24: Livebook.Hubs.fetch_metadatas/0
        (livebook 0.7.2) lib/livebook_web/live/hooks/sidebar_hook.ex:12: LivebookWeb.SidebarHook.on_mount/4
        (phoenix_live_view 0.18.2) lib/phoenix_live_view/lifecycle.ex:148: anonymous fn/4 in Phoenix.LiveView.Lifecycle.mount/3
        (phoenix_live_view 0.18.2) lib/phoenix_live_view/lifecycle.ex:183: Phoenix.LiveView.Lifecycle.reduce_socket/3
        (phoenix_live_view 0.18.2) lib/phoenix_live_view/utils.ex:319: anonymous fn/6 in Phoenix.LiveView.Utils.maybe_call_live_view_mount!/5
        (telemetry 1.2.1) /tmp/mix-local-installer-fetcher-U5e5yQ/deps/telemetry/src/telemetry.erl:321: :telemetry.span/3
00:44:19.074 [error] #PID&lt;0.533.0&gt; running LivebookWeb.Endpoint (connection #PID&lt;0.532.0&gt;, stream id 1) terminated
Server: livebook.sleipner.ru:80 (http)
Request: GET /
** (exit) an exception was raised:
    ** (FunctionClauseError) no function clause matching in Livebook.Hubs.to_struct/1
        (livebook 0.7.2) lib/livebook/hubs.ex:104: Livebook.Hubs.to_struct(%{hub_emoji: "🏠", hub_name: "My Hub", id: "personal-hub", secret_key: "4oB-wLUGbX8SbVcfb6gzG4q4-8wSmmPvXOXmS7y2_wdMiyvSy9IDPr-83n2L7Dh28J2V_uDljhFjVtQ_v46fdw"})
        (elixir 1.15.0-rc.2) lib/enum.ex:1693: Enum."-map/2-lists^map/1-1-"/2
        (livebook 0.7.2) lib/livebook/hubs.ex:24: Livebook.Hubs.fetch_metadatas/0
        (livebook 0.7.2) lib/livebook_web/live/hooks/sidebar_hook.ex:12: LivebookWeb.SidebarHook.on_mount/4
        (phoenix_live_view 0.18.2) lib/phoenix_live_view/lifecycle.ex:148: anonymous fn/4 in Phoenix.LiveView.Lifecycle.mount/3
        (phoenix_live_view 0.18.2) lib/phoenix_live_view/lifecycle.ex:183: Phoenix.LiveView.Lifecycle.reduce_socket/3
        (phoenix_live_view 0.18.2) lib/phoenix_live_view/utils.ex:319: anonymous fn/6 in Phoenix.LiveView.Utils.maybe_call_live_view_mount!/5
        (telemetry 1.2.1) /tmp/mix-local-installer-fetcher-U5e5yQ/deps/telemetry/src/telemetry.erl:321: :telemetry.span/3
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="291402" 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/how-do-i-redifine-modules-in-livebook/56442/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-291402" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="291402"
                     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="349609" data-post-id="349609">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>New joiner here. It’s very unintuitive.  Wouldn’t a solution be to restart a livebook (a bit like jupyter restarts a kernel wiping all state)?</p>
<p>(I am on mac (v.0.14.5) but could not find a way to restart.)</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="349609" 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/how-do-i-redifine-modules-in-livebook/56442/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-349609" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="349609"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>