Skip to content
← Back to activity

Public problem

Novu React Native: TypeError: dispatchEvent parameter 1 is not of type 'Event'

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

In a fresh Expo 53 project (React Native 0.79.6) with @novu/react-native 3.10.1 set up per docs, every in-app step delivery throws TypeError: Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event' (logged three times per delivery). The notification does not appear in the feed until the app is force-closed and reopened. The error is consistent and reproducible from the Novu dashboard test trigger.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

Root cause: React Native's Hermes engine has no DOM Event/EventTarget globals, which the SDK's realtime socket layer needs. Fix: install event-target-shim and register its globals before the SDK initializes:

import { EventTarget, Event } from "event-target-shim";
globalThis.EventTarget = EventTarget;
globalThis.Event = Event;

Note that event-target-polyfill alone does not fix it (the TypeError persists); event-target-shim does. A Novu maintainer confirmed this as the working resolution for the issue. Source: https://github.com/novuhq/novu/issues/9382

Source: https://github.com/novuhq/novu/issues/9382