<?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>DEV Community: nahom kasa</title>
    <description>The latest articles on DEV Community by nahom kasa (@nahom_kasa_a3859f822d2b4c).</description>
    <link>https://dev.to/nahom_kasa_a3859f822d2b4c</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%2F3026568%2F836b2329-c247-4b56-a3d1-6e54f4589773.png</url>
      <title>DEV Community: nahom kasa</title>
      <link>https://dev.to/nahom_kasa_a3859f822d2b4c</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nahom_kasa_a3859f822d2b4c"/>
    <language>en</language>
    <item>
      <title>I've just released VS extension AI git-Auto-commit v0.1.0 ! - Alt + O = git commit 🎉 No need for you API key.</title>
      <dc:creator>nahom kasa</dc:creator>
      <pubDate>Wed, 30 Apr 2025 05:21:33 +0000</pubDate>
      <link>https://dev.to/nahom_kasa_a3859f822d2b4c/ai-powered-vs-code-extension-that-commits-and-pushes-with-one-shortcut-17bb</link>
      <guid>https://dev.to/nahom_kasa_a3859f822d2b4c/ai-powered-vs-code-extension-that-commits-and-pushes-with-one-shortcut-17bb</guid>
      <description>&lt;p&gt;Hey devs,&lt;/p&gt;

&lt;p&gt;I got tired of manually making commit messages, so I built a VS extension that auto-pushes changes when you press Alt + O. It uses AI to generate commit messages on its own.&lt;/p&gt;

&lt;p&gt;I’m thinking of launching it, but I’ll decide based on the reaction this post gets. If I get 10+ likes, I’ll release it!&lt;/p&gt;

&lt;p&gt;It’s open-source, so feel free to contribute.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>opensource</category>
      <category>git</category>
      <category>developer</category>
    </item>
    <item>
      <title>Prisma + Neon DB Error P1001 Explained (with Pizza 🍕)</title>
      <dc:creator>nahom kasa</dc:creator>
      <pubDate>Tue, 08 Apr 2025 15:49:01 +0000</pubDate>
      <link>https://dev.to/nahom_kasa_a3859f822d2b4c/prisma-neon-db-error-p1001-explained-with-pizza--5hho</link>
      <guid>https://dev.to/nahom_kasa_a3859f822d2b4c/prisma-neon-db-error-p1001-explained-with-pizza--5hho</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsj7w1gazv2x4hpc4tlzg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsj7w1gazv2x4hpc4tlzg.png" alt="Image description" width="800" height="128"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🍕 Prisma and Neon DB: A Pizza Delivery Metaphor for Error P1001
&lt;/h2&gt;

&lt;p&gt;So I was working on a project using &lt;strong&gt;Prisma&lt;/strong&gt; and &lt;strong&gt;Neon DB&lt;/strong&gt;, and I ran into this lovely error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Error: P1001: Can't reach database server at `your-neon-url`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At first glance, it’s just a boring connection issue. But I realized the problem is actually &lt;strong&gt;super simple&lt;/strong&gt; — and best explained with pizza 🍕.&lt;/p&gt;

&lt;p&gt;Let me show you what I mean.&lt;/p&gt;




&lt;h3&gt;
  
  
  📦 Imagine This:
&lt;/h3&gt;

&lt;p&gt;You’re a &lt;strong&gt;pizza delivery guy&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Someone places an order and sends you their location. You follow the map, drive all the way there, and then...&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You’re outside the city. There's no house. Just a field. 🧍‍♂️&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You call the number. Turns out they &lt;strong&gt;accidentally added a wrong number&lt;/strong&gt; to their address. So you couldn't reach them.&lt;/p&gt;

&lt;p&gt;This is &lt;strong&gt;exactly what happens when your &lt;code&gt;DATABASE_URL&lt;/code&gt; is incorrect&lt;/strong&gt; in your Prisma &lt;code&gt;.env&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;Prisma is the delivery guy.&lt;/p&gt;

&lt;p&gt;You (the developer) gave the delivery address (DB URL), but if you mistype even one character — Prisma won’t find the house. It’ll just stand there confused in a digital field.&lt;/p&gt;




&lt;h3&gt;
  
  
  📞 Scenario 2: Wrong Password = Stranger at the Door
&lt;/h3&gt;

&lt;p&gt;You finally find the house, but when you knock, someone else opens the door and says:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Yeah yeah, I ordered a pizza. Hand it over.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But something feels off. You check the phone number — it doesn't match the order.&lt;/p&gt;

&lt;p&gt;That’s what happens when your &lt;strong&gt;database password or user is wrong&lt;/strong&gt;. Prisma finds the server, but it doesn’t trust the person who answered.&lt;/p&gt;

&lt;p&gt;So again — the delivery fails.&lt;/p&gt;




&lt;h3&gt;
  
  
  🛠️ The Fix
&lt;/h3&gt;

&lt;p&gt;Just like in real life:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Double-check the address&lt;/strong&gt;
Make sure your &lt;code&gt;.env&lt;/code&gt; file has the right database URL, with no typos:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  DATABASE_URL="postgresql://your_user:your_password@your_neon_url/db_name"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Confirm your identity&lt;/strong&gt;
Ensure that the username and password actually match what Neon DB expects.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can find your correct connection string inside your &lt;strong&gt;Neon dashboard&lt;/strong&gt;. They even have a "Prisma" format ready to copy.&lt;/p&gt;

&lt;p&gt;Once that’s fixed, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx prisma db push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Boom — your data (pizza) gets delivered.&lt;/p&gt;




&lt;h3&gt;
  
  
  🧠 Final Thoughts
&lt;/h3&gt;

&lt;p&gt;Errors like &lt;code&gt;P1001&lt;/code&gt; seem technical, but they usually come down to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Wrong address (host, port, DB name)&lt;/li&gt;
&lt;li&gt;Wrong credentials (username/password)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Next time it happens, just think:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“If I were a pizza guy, could I find the customer and trust them enough to hand over the pizza?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Your data is the pizza. Don’t let it get cold 🍕&lt;/p&gt;




&lt;p&gt;Thanks for reading! If this helped you, leave a heart ❤️ or drop your own Prisma story in the comments.&lt;/p&gt;

</description>
      <category>prisma</category>
      <category>database</category>
      <category>neon</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Clerk, Webhooks, and Svix — A Story You'll Never Forget</title>
      <dc:creator>nahom kasa</dc:creator>
      <pubDate>Mon, 07 Apr 2025 18:16:09 +0000</pubDate>
      <link>https://dev.to/nahom_kasa_a3859f822d2b4c/clerk-webhooks-and-svix-a-story-youll-never-forget-2bg4</link>
      <guid>https://dev.to/nahom_kasa_a3859f822d2b4c/clerk-webhooks-and-svix-a-story-youll-never-forget-2bg4</guid>
      <description>&lt;p&gt;I’ve got a website. It’s connected to Clerk for authentication.&lt;/p&gt;

&lt;p&gt;One day, my website tells Clerk:&lt;/p&gt;

&lt;p&gt;"Hey Clerk, if you ever create a new user, send me a messenger and tell me about it."&lt;/p&gt;

&lt;p&gt;Clerk’s like:&lt;/p&gt;

&lt;p&gt;"Sure thing. Just give me the address to your office (your deployed site’s URL), and I’ll send the messenger there."&lt;/p&gt;

&lt;p&gt;But my website is still in development, running on localhost:&lt;/p&gt;

&lt;p&gt;“Hmm... Can you just send the guy to my house instead (localhost)?”&lt;/p&gt;

&lt;p&gt;Clerk responds:&lt;/p&gt;

&lt;p&gt;“Nah... I can’t reach houses. I only send messengers to real offices on the internet.”&lt;/p&gt;

&lt;p&gt;So my website’s like:&lt;/p&gt;

&lt;p&gt;“No worries. I’ll call a taxi (ngrok/localtunnel), and they’ll bring your messenger from your office to my house, and return them back.”&lt;/p&gt;

&lt;p&gt;Now, things are cool… until the paranoia hits.&lt;/p&gt;

&lt;p&gt;My website suddenly realizes:&lt;/p&gt;

&lt;p&gt;“Wait a minute... What if some random guy pretends to be from Clerk? What if he tells me something like ‘You owe $1 billion in fake user debt?’ 😨”&lt;/p&gt;

&lt;p&gt;So my website goes:&lt;/p&gt;

&lt;p&gt;“Hey Clerk, how do I know it’s really your guy you’re sending me?”&lt;/p&gt;

&lt;p&gt;Clerk smiles:&lt;/p&gt;

&lt;p&gt;“Great question. I actually tattoo a signature on his head (cryptographic signature). You can call Svix, and they’ll tell you how to check that signature.”&lt;/p&gt;

&lt;p&gt;My website’s like:&lt;/p&gt;

&lt;p&gt;“Okay perfect. I’ll tell my taxi driver to snap a pic of the guy’s head and I’ll compare the tattoo to what Svix expects. If it matches, I’ll let him in. If not — kicked out.”&lt;/p&gt;

&lt;p&gt;Then Clerk is like:&lt;/p&gt;

&lt;p&gt;“You’re damn brilliant. We could even give the guy a T-shirt with a QR code instead of a tattoo, if that helps.”&lt;/p&gt;

&lt;p&gt;And my website’s like:&lt;/p&gt;

&lt;p&gt;“Yeah that works too. Fashion and security, baby. Let’s go.”&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Femlubldzd92x0qp4xeif.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Femlubldzd92x0qp4xeif.png" alt="Image description" width="800" height="1200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🔐 What Just Happened Technically
&lt;/h2&gt;

&lt;p&gt;Clerk Webhooks: Tell you when users are created, updated, etc.&lt;/p&gt;

&lt;p&gt;Your Localhost: Can’t receive messages directly, so you use ngrok to tunnel requests.&lt;/p&gt;

&lt;p&gt;Svix: Validates that the message really came from Clerk.&lt;/p&gt;

&lt;p&gt;Signature: Clerk signs the request (tattoo on the guy’s head).&lt;/p&gt;

&lt;p&gt;You (your code): Use Svix’s library to verify the signature before trusting the message.&lt;/p&gt;

&lt;p&gt;If you ever forgot how webhooks work — just remember the story of the guy, the taxi, the tattoo, and the QR code.&lt;/p&gt;

&lt;p&gt;You’ll never look at API security the same again 😎&lt;/p&gt;

</description>
      <category>cleancode</category>
      <category>webhook</category>
      <category>clerk</category>
      <category>svix</category>
    </item>
    <item>
      <title>💥 Fixing "Invalid image file" Error When Uploading Videos to Cloudinary with Next.js</title>
      <dc:creator>nahom kasa</dc:creator>
      <pubDate>Mon, 07 Apr 2025 15:06:49 +0000</pubDate>
      <link>https://dev.to/nahom_kasa_a3859f822d2b4c/fixing-invalid-image-file-error-when-uploading-videos-to-cloudinary-with-nextjs-3bae</link>
      <guid>https://dev.to/nahom_kasa_a3859f822d2b4c/fixing-invalid-image-file-error-when-uploading-videos-to-cloudinary-with-nextjs-3bae</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuzfktks4lasmqqtsx3qg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuzfktks4lasmqqtsx3qg.png" alt="Image description" width="783" height="625"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While building a simple video uploader in Next.js, I ran into an error that took way longer to fix than I expected:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{ message: 'Invalid image file', name: 'Error', http_code: 400 }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you're uploading videos to Cloudinary using upload_stream and hit this error, this post will save you hours.&lt;/p&gt;

&lt;p&gt;🔍 The Problem&lt;br&gt;
I was sending a video/mp4 file using formData from my frontend and handling the upload inside a Next.js POST route using upload_stream from the cloudinary Node.js SDK.&lt;/p&gt;

&lt;p&gt;Here’s a simplified version of the code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ts
Copy
Edit
const result = await new Promise((resolve, reject) =&amp;gt; {
  const uploadStream = cloudinary.v2.uploader.upload_stream(
    { folder: "Videos" },
    (error, result) =&amp;gt; {
      if (error) reject(error)
      else resolve(result)
    }
  )
  uploadStream.end(buffer)
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The file was valid, the form data was working, and the backend received everything correctly. But it kept throwing this error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;css
Copy
Edit
{ message: 'Invalid image file', name: 'Error', http_code: 400 }
At first, I thought something was wrong with the file type or encoding.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nope. The problem was simpler...&lt;/p&gt;

&lt;p&gt;💡 The Real Issue&lt;br&gt;
Cloudinary defaults to resource_type: "image" unless you explicitly tell it otherwise.&lt;/p&gt;

&lt;p&gt;So even if you send a video file, Cloudinary still tries to process it as an image... and obviously fails.&lt;/p&gt;

&lt;p&gt;✅ The Fix&lt;br&gt;
Just add this to your upload_stream options:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ts
Copy
Edit
{ folder: "Videos", resource_type: "video" }
Now the full code looks like this:

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ts
Copy
Edit
const result = await new Promise((resolve, reject) =&amp;gt; {
  const uploadStream = cloudinary.v2.uploader.upload_stream(
    { folder: "Videos", resource_type: "video" },
    (error, result) =&amp;gt; {
      if (error) reject(error)
      else resolve(result)
    }
  )
  uploadStream.end(buffer)
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And just like that, the upload works.&lt;/p&gt;

&lt;p&gt;🧠 Lesson Learned&lt;br&gt;
Cloudinary expects you to declare what kind of file you're uploading. If you don’t specify, it defaults to "image", which can lead to confusing errors when you're actually uploading a video or something else.&lt;/p&gt;

&lt;p&gt;Use resource_type: "image" for images (default)&lt;/p&gt;

&lt;p&gt;Use resource_type: "video" for video files&lt;/p&gt;

&lt;p&gt;Use resource_type: "raw" for other binary files like PDFs, zips, etc.&lt;/p&gt;

&lt;p&gt;🚀 Final Thoughts&lt;br&gt;
These kinds of small but painful bugs are a great reminder: tools often have smart defaults, but they’re not always smart enough. Knowing how they assume things can save you time.&lt;/p&gt;

&lt;p&gt;If you found this helpful, follow me on Dev.to — I share real bugs I solve while building with Next.js, Cloudinary, and other full-stack tools.&lt;/p&gt;

&lt;p&gt;Happy building!&lt;/p&gt;

</description>
      <category>cloudinary</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
