<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: relkimm</title>
    <description>The latest articles on Forem by relkimm (@relkimm).</description>
    <link>https://forem.com/relkimm</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3644738%2F2b913481-bec8-41e8-a5de-61eb438ea572.png</url>
      <title>Forem: relkimm</title>
      <link>https://forem.com/relkimm</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/relkimm"/>
    <language>en</language>
    <item>
      <title>Turbopack keeps crashing? I made a CLI that auto-restarts it.</title>
      <dc:creator>relkimm</dc:creator>
      <pubDate>Thu, 04 Dec 2025 07:20:48 +0000</pubDate>
      <link>https://forem.com/relkimm/turbopack-keeps-crashing-i-made-a-cli-that-auto-restarts-it-11nn</link>
      <guid>https://forem.com/relkimm/turbopack-keeps-crashing-i-made-a-cli-that-auto-restarts-it-11nn</guid>
      <description>&lt;p&gt;I've been using Claude Code for my side projects lately.&lt;/p&gt;

&lt;p&gt;It's great, but there's one problem. Claude keeps editing files automatically, which triggers rebuilds. And Turbopack doesn't handle that well.&lt;/p&gt;

&lt;p&gt;The loop became my life:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Claude edits a file&lt;/li&gt;
&lt;li&gt;Turbopack crashes&lt;/li&gt;
&lt;li&gt;Ctrl+C → &lt;code&gt;npm run dev&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Claude edits another file&lt;/li&gt;
&lt;li&gt;Crash again&lt;/li&gt;
&lt;li&gt;Ctrl+C → &lt;code&gt;npm run dev&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;...repeat all day&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After a weekend of this, I built a CLI to handle it automatically.&lt;/p&gt;




&lt;h2&gt;
  
  
  next-zombie 🧟
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx next-zombie
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It watches your dev server. When it crashes, it restarts. Automatically.&lt;/p&gt;

&lt;p&gt;No more Ctrl+C. No more switching terminals. Just keep coding.&lt;/p&gt;

&lt;p&gt;It also clears &lt;code&gt;.next&lt;/code&gt; cache before each restart.&lt;/p&gt;




&lt;h2&gt;
  
  
  What It Looks Like
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Starting up:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ npx next-zombie
[next-zombie] Cleaning .next cache...
[next-zombie] Starting Next.js with auto-recovery...
[next-zombie] $ pnpm run dev

  ▲ Next.js 15.0.3 (Turbopack)
  - Local:        http://localhost:3000

 ✓ Ready in 1.2s
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;When crash happens:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; ⨯ [Error: ENOENT: no such file or directory, open '.next/static/development/_buildManifest.js.tmp']

[next-zombie] Cache error detected!
[next-zombie] Restarting in 0.5s...
[next-zombie] Cleaning .next cache...
[next-zombie] Restarting... (#1)
[next-zombie] Starting Next.js with auto-recovery...
[next-zombie] $ pnpm run dev

  ▲ Next.js 15.0.3 (Turbopack)
  - Local:        http://localhost:3000

 ✓ Ready in 1.1s
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;On exit:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;^C
[next-zombie] Session: 3 restarts, uptime 1h 42m
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Before &amp;amp; After
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Before:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Crash → Ctrl+C → npm run dev → Crash → Ctrl+C → npm run dev → ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;After:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Crash → [next-zombie restarts] → keep coding
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Recovery time: ~700ms&lt;/p&gt;




&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;next-zombie
    │
    ├─► Start: pnpm run dev
    │
    ├─► Monitor stdout/stderr
    │       │
    │       ├─► Cache error? → Restart
    │       │
    │       └─► Crash? → Restart
    │
    └─► Ctrl+C → Show stats → Exit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Detected patterns:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;_buildManifest.js.tmp&lt;/code&gt; ENOENT&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.next&lt;/code&gt; cache errors&lt;/li&gt;
&lt;li&gt;Any non-zero exit&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;✅ &lt;strong&gt;Auto-restart&lt;/strong&gt; — no more Ctrl+C loop&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Auto cache clearing&lt;/strong&gt; — clears &lt;code&gt;.next&lt;/code&gt; before restart&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;PM detection&lt;/strong&gt; — works with npm, pnpm, yarn, bun&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Session stats&lt;/strong&gt; — see how many restarts happened&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Install
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Try it now:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx next-zombie
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Add to project:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-D&lt;/span&gt; next-zombie
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"dev"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"next-zombie"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Q: Does this fix Turbopack?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No. It's a workaround. When Turbopack crashes, next-zombie handles the restart.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q: Production?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Dev only. Production builds don't have this issue.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q: Why not disable Turbopack?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can. But Turbopack is fast. I'd rather have speed + auto-recovery.&lt;/p&gt;




&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;📦 npm: &lt;a href="https://www.npmjs.com/package/next-zombie" rel="noopener noreferrer"&gt;next-zombie&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🐙 GitHub: &lt;a href="https://github.com/relkimm/next-zombie" rel="noopener noreferrer"&gt;relkimm/next-zombie&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;If this saves you some frustration:&lt;/p&gt;

&lt;p&gt;⭐ &lt;a href="https://github.com/relkimm/next-zombie" rel="noopener noreferrer"&gt;Star on GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Found a new crash pattern?&lt;/p&gt;

&lt;p&gt;🐛 &lt;a href="https://github.com/relkimm/next-zombie/issues/new" rel="noopener noreferrer"&gt;Open an issue&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Let the zombie handle the restarts. 🧟&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>typescript</category>
      <category>webdev</category>
      <category>cli</category>
    </item>
  </channel>
</rss>
