Bolt realtime

Live Notifications Not Working in Bolt App

Your Bolt.new application has a notification system that stores notifications in the database, but users only see them after refreshing the page. The notification bell or badge doesn't update in real-time, so users miss time-sensitive alerts like new orders, messages, or system warnings.

Live notifications are essential for any interactive application. When a user receives a new message, a buyer places an order, or a system event requires attention, the user needs to know immediately without manually checking. A notification system that requires page refreshes defeats its entire purpose.

Bolt typically generates the notification storage and display components but misses the real-time delivery mechanism. The notifications exist in the database but the frontend has no way to know about new ones until it re-fetches the list.

Error Messages You Might See

Realtime subscription error: table not in publication TypeError: Cannot read property 'length' of undefined (notification list) Channel subscription timeout Error: notification_changes channel already exists
Realtime subscription error: table not in publicationTypeError: Cannot read property 'length' of undefined (notification list)Channel subscription timeoutError: notification_changes channel already exists

Common Causes

  • Polling not implemented — No mechanism to periodically check for new notifications or receive them in real-time
  • Supabase Realtime subscription missing — Notifications are stored in a table but there's no subscription listening for new inserts
  • Notification count not updating — The badge shows the count from initial page load and never recalculates when new notifications arrive
  • Global state not connected — The notification listener runs in one component but the badge count is managed in a separate component without shared state
  • User filter not applied — The Realtime subscription listens for all notifications instead of filtering for the current user's notifications

How to Fix It

  1. Create a notification provider — Build a React context that wraps your app and manages notification state globally, so all components can access the notification count and list
  2. Subscribe to user-specific notifications — Add a Realtime subscription filtered to the current user: supabase.channel('notifications').on('postgres_changes', { event: 'INSERT', schema: 'public', table: 'notifications', filter: `user_id=eq.${userId}` }, handleNewNotification).subscribe()
  3. Update badge count reactively — When a new notification arrives, increment the unread count: setUnreadCount(prev => prev + 1) and add the notification to the list
  4. Show toast for important notifications — Display a temporary toast notification for high-priority items using a library like react-hot-toast or sonner
  5. Mark as read on view — When the user opens the notification panel, mark visible notifications as read: await supabase.from('notifications').update({ read: true }).eq('user_id', userId).eq('read', false)

Real developers can help you.

zipking zipking I am a technologist and product builder dedicated to creating high-impact solutions at the intersection of AI and specialized markets. Currently, I am focused on PropScan (EstateGuard), an AI-driven SaaS platform tailored for the Japanese real estate industry, and exploring the potential of Archify. As an INFJ-T, I approach development with a "systems-thinking" mindset—balancing technical precision with a deep understanding of user needs. I particularly enjoy the challenge of architecting Vertical AI SaaS and optimizing Small Language Models (SLMs) to solve specific, real-world business problems. Whether I'm in a CTO-level leadership role or hands-on with the code, I thrive on building tools that turn complex data into actionable value. Anthony Akpan Anthony Akpan Developer with 8 years of experience building softwares fro startups MFox MFox Full-stack professional senior engineer (15+years). Extensive experience in software development, qa, and IP networking. Antriksh Narang Antriksh Narang 5 years+ Experienced Dev (Specially in Web Development), can help in python, javascript, react, next.js and full stack web dev technologies. Prakash Prajapati Prakash Prajapati I’m a Senior Python Developer specializing in building secure, scalable, and highly available systems. I work primarily with Python, Django, FastAPI, Docker, PostgreSQL, and modern AI tooling such as PydanticAI, focusing on clean architecture, strong design principles, and reliable DevOps practices. I enjoy solving complex engineering problems and designing systems that are maintainable, resilient, and built to scale. Stanislav Prigodich Stanislav Prigodich 15+ years building iOS and web apps at startups and enterprise companies. I want to use that experience to help builders ship real products - when something breaks, I'm here to fix it. Richard McSorley Richard McSorley Full-Stack Software Engineer with 8+ years building high-performance applications for enterprise clients. Shipped production systems at Walmart (4,000+ stores), Cigna (20M+ users), and Arkansas Blue Cross. 5 patents in retail/supply chain tech. Currently focused on AI integrations, automation tools, and TypeScript-first architectures. Basel Issmail Basel Issmail ’m a Senior Full-Stack Developer and Tech Lead with experience designing and building scalable web platforms. I work across the full development lifecycle, from translating business requirements into technical architecture to delivering reliable production systems. My work focuses on modern web technologies, including TypeScript, Angular, Node.js, and cloud-based architectures. I enjoy solving complex technical problems and helping teams turn product ideas and prototypes into working platforms that can grow and scale. In addition to development, I often collaborate closely with product managers, business analysts, designers, and QA teams to ensure that solutions align with both technical and business goals. I enjoy working with startups and product teams where I can contribute both as a hands-on engineer and as a technical partner in designing and delivering impactful software. Rudra Bhikadiya Rudra Bhikadiya I build and fix web apps across Next.js, Node.js, and DBs. Comfortable jumping into messy code, broken APIs, and mysterious bugs. If your project works in theory but not in reality, I help close that gap. prajwalfullstack prajwalfullstack Hi Im a full stack developer, a vibe coded MVP to Market ready product, I'm here to help

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help

Frequently Asked Questions

Should I use polling or WebSocket for notifications?

Use Supabase Realtime (WebSocket) for instant delivery. Polling every few seconds creates unnecessary load and still has delays. Supabase Realtime pushes new rows to the client within milliseconds of database insertion.

How do I handle notifications when the user is offline?

Store all notifications in the database with a 'read' boolean field. When the user reconnects, fetch all unread notifications: supabase.from('notifications').select().eq('user_id', userId).eq('read', false). The Realtime subscription only handles new notifications while connected.

Related Bolt Issues

Can't fix it yourself?
Real developers can help.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help