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.

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. 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. Krishna Sai Kuncha Krishna Sai Kuncha Experienced Professional Full stack Developer with 8+ years of experience across react, python, js, ts, golang and react-native. Developed inhouse websearch tooling for AI before websearch was solved : ) Nam Tran Nam Tran 10 years as fullstack developer Sage Fulcher Sage Fulcher Hey I'm Sage! Im a Boston area software engineer who grew up in South Florida. Ive worked at a ton of cool places like a telehealth kidney care startup that took part in a billion dollar merger (Cricket health/Interwell health), a boutique design agency where I got to work on a ton of exciting startups including a photography education app, a collegiate Esports league and more (Philosophie), a data analytics as a service startup in Cambridge (MA) as well as at Phillips and MIT Lincoln Lab where I designed and developed novel network security visualizations and analytics. I've been writing code and furiously devoted to using computers to make people’s lives easier for about 17 years. My degree is in making computers make pretty lights and sounds. Outside of work I love hip hop, the Celtics, professional wrestling, magic the gathering, photography, drumming, and guitars (both making and playing them) 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.** Victor Denisov Victor Denisov Developer Bastien Labelle Bastien Labelle Full stack dev w/ 20+ years of experience 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. Jared Hasson Jared Hasson Full time lead founding dev at a cyber security saas startup, with 10 yoe and a bachelor's in CS. Building & debugging software products is what I've spent my time on for forever

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