dynamic imports

September 19, 2025


spent most of the day resolving frontend pr. learned about dynamic imports for ssr, async leaflet loading, and common pitfalls.

the problem: leaflet requires window object and can't run during SSR

solution: use Next.js dynamic with {ssr : false} for components that imports the map

only use in next.js pages that can be server-rendered

not needed in client components that has 'use client'

also learned to name variables safely because all data can be seen by users here, so naming something like <third_party_client>_score can expose what tech you're using under the hood.