๐—ช๐—›๐—˜๐—ก ๐—” ๐—ฆ๐—œ๐— ๐—ฃ๐—Ÿ๐—˜ ๐—ฅ๐—˜๐—™๐—ฅ๐—˜๐—ฆ๐—› ๐—•๐—ฅ๐—ข๐—ž๐—˜ ๐—ข๐—จ๐—ฅ ๐—”๐—ฃ๐—ฃ

We found a bug. Top routes worked fine. Deep routes caused full page reloads. The sidebar reset every time. The app felt unstable.

It worked locally. It failed in production.

We used Next.js static export on Azure Static Web Apps. This setup has no server runtime. It serves static files.

The issue was soft navigation. Next.js needs route payload data for smooth transitions. It needs HTML for the first load.

Our Azure rewrite rules were too broad. Azure sent HTML when Next.js asked for payload data. The router failed. The app reloaded.

We fixed this with automation. We built a tool to generate rewrite rules from build output. The tool now:

This removed manual errors.

If you use static export on Azure:

Hard frontend bugs often live between build output and hosting rules.

Source: https://dev.to/suraj_thallapelli_55c6f59/when-a-simple-refresh-broke-our-production-app-nextjs-static-export-on-azure-2ano