From f79663e8f8a7383bf0d2de05b0efeece9fc37a54 Mon Sep 17 00:00:00 2001 From: Biswajeet Das Date: Thu, 16 Jan 2025 17:10:14 +0530 Subject: [PATCH] prevent component rendering on server-side --- packages/js/src/ui/novuUI.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/js/src/ui/novuUI.tsx b/packages/js/src/ui/novuUI.tsx index 18f46fe5a75..e52443d0414 100644 --- a/packages/js/src/ui/novuUI.tsx +++ b/packages/js/src/ui/novuUI.tsx @@ -1,5 +1,5 @@ import { Accessor, Setter, ComponentProps, createSignal } from 'solid-js'; -import { MountableElement, render } from 'solid-js/web'; +import { isServer, MountableElement, render } from 'solid-js/web'; import type { NovuOptions } from '../types'; import { NovuComponent, NovuComponentName, novuComponents, Renderer } from './components/Renderer'; import { generateRandomString } from './helpers'; @@ -69,7 +69,9 @@ export class NovuUI { this.#preferencesFilter = preferencesFilter; this.#setPreferencesFilter = setPreferencesFilter; - this.#mountComponentRenderer(); + if (!isServer) { + this.#mountComponentRenderer(); + } } #mountComponentRenderer(): void {