Skip to content

Commit 476e140

Browse files
Copilothotlong
andcommitted
Fix SSR hydration mismatch in PluginLoader
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 5f8c39f commit 476e140

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

apps/site/app/components/PluginLoader.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,13 @@ export function PluginLoader({ plugins, children }: PluginLoaderProps) {
3939
const [loaded, setLoaded] = useState(false);
4040

4141
useEffect(() => {
42-
if (typeof window === 'undefined') {
43-
return;
44-
}
45-
4642
const loadPlugins = async () => {
43+
// On server side, skip actual imports but mark as loaded to avoid hydration mismatch
44+
if (typeof window === 'undefined') {
45+
setLoaded(true);
46+
return;
47+
}
48+
4749
try {
4850
// Dynamically import plugins based on the list
4951
const imports = plugins.map(async (plugin) => {

0 commit comments

Comments
 (0)