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.

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. 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. Victor Denisov Victor Denisov Developer Caio Rodrigues Caio Rodrigues I'm a full-stack developer focused on building practical and scalable web applications. My main experience is with **React, TypeScript, and modern frontend architectures**, where I prioritize clean code, component reusability, and maintainable project structures. I have strong experience working with **dynamic forms, state management (Redux / React Hook Form), and complex data-driven interfaces**. I enjoy solving real-world problems by turning ideas into reliable software that companies can actually use in their daily operations. Beyond coding, I care about **software quality and architecture**, following best practices for componentization, code organization, and performance optimization. I'm also comfortable working across the stack when needed, integrating APIs, handling business logic, and helping transform prototypes into production-ready systems. My goal is always to deliver solutions that are **simple, efficient, and genuinely useful for the people using them.** Bastien Labelle Bastien Labelle Full stack dev w/ 20+ years of experience Matthew Jordan Matthew Jordan I've been working at a large software company named Kainos for 2 years, and mainly specialise in Platform Engineering. I regularly enjoy working on software products outside of work, and I'm a huge fan of game development using Unity. I personally enjoy Python & C# in my spare time, but I also specialise in multiple different platform-related technologies from my day job. Jen Jacobsen Jen Jacobsen I’m a Full-Stack Developer with over 10 years of experience building modern web and mobile applications. I enjoy working across the full product lifecycle — turning ideas into real, well-built products that are intuitive for users and scalable for businesses. I particularly enjoy building mobile apps, modern web platforms, and solving complex technical problems in a way that keeps systems clean, reliable, and easy to maintain. 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. 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. Daniel Vázquez Daniel Vázquez Software Engineer with over 10 years of experience on Startups, Government, big tech industry & consulting.

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