Urgent.News

What's breaking now, across thousands of outlets.

Tech

Crashing Bugs, Not Servers: My First Open-Source Bug Smash Journey

This is a submission for DEV's Summer Bug Smash: Clear the Lineup powered by Sentry Errors/Improvements(Hizba-cloud) Project Overview For this challenge, I jumped into Formbricks —the open-source, privacy-first experience management and survey platform. Setting up a heavy, production-grade Next.js stack locally always comes with its fair share of surprises, and my local environment gave me a wild…

This report details a first-hand account of the author's experience participating in DEV's Summer Bug Smash challenge, Clear the Lineup, powered by Sentry Errors/Improvements. The project involved working on Formbricks, an open-source, privacy-first experience management and survey platform. The author's journey began with setting up a production-grade Next.js stack locally, which presented a series of hurdles.

The first obstacle encountered was the Edge Runtime Crash. Next.js generated strict build errors due to the @formbricks/logger module attempting to execute Node.js-specific process listeners (process.on(SIGINT, ...)) inside files touched by Edge instrumentation and Sentry edge configurations. As the Edge runtime does not support Node APIs, the compiler reacted negatively.

Next, the Database & Redis Timeouts issue arose. After successfully passing the build phase, Prisma began throwing Connection terminated due to connection timeout errors when communicating with the cloud-hosted Neon database pooler and Upstash Redis instance. This issue was caused by abrupt SSL drops and unconfigured socket limits.

To tackle these challenges, the author made specific adjustments to the code. The first modification focused on guarding Node process listeners in the logger module. By checking if the NEXT_RUNTIME environment variable equaled 'nodejs', the author prevented the Edge runtime from evaluating these listeners, thereby safeguarding the system.

The second change involved optimizing connection strings in the .env file. The author added explicit timeout and pool limits to stabilize remote connections to the Neon database pooler and Upstash Redis instance. This adjustment ensured smoother communication between local resources and external cloud services, enabling seamless survey rendering, database migrations, and UI previews.

Lastly, the author improved the overall architecture by employing dynamic imports and explicit environment checks against the NEXT_RUNTIME environment variable. This separation allowed for clean isolation of server-side logging and worker job scheduling from the lightweight Edge runtime. Moreover, the author configured Sentry's error tracking boundaries using safe conditional checks, ensuring Sentry initialized gracefully only when a DSN was provided. This strategy helped avoid local noise or compilation crashes in restricted environments.

In summary, through careful adjustments to the Next.js stack, the author successfully navigated the Edge Runtime Crash and Database & Redis Timeouts issues. The implementation of clean architecture, resilient local setup, and optimal use of Sentry led to a successful local development experience with Formbricks.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Leetcode 41 : First Missing Positive Integer

Question : Given an unsorted integer array, find the smallest missing positive integer. Example : Input: [1,2,0] Output: 3 Input: [3,4,-1,1] Output: 2 Input: [7,8,9,11,12] Output: 1 Idea : In 1st…

More from Sunday 23 August →