Troubleshoot the most frequent configuration and performance issues when integrating Iconweuse in your codebase.
If you see errors in your developer console showing that webfont loading has been blocked by Cross-Origin Resource Sharing (CORS) policy, make sure to add the `crossorigin` attribute to your stylesheet reference:
<link href="https://cdn.iconweuse.com/icon/k4z9rm2tq1" rel="stylesheet" crossOrigin="anonymous" />When using dynamic icons inside server-rendered React applications (e.g. Next.js App Router), you may encounter hydration warnings if icons render differently on the server compared to the client.
To resolve this, ensure you are not generating random icons or referencing browser-specific elements (like `window.innerWidth`) during the initial render. If needed, wrap the component in a client-only fallback:
import { useEffect, useState } from 'react';
import { Search } from 'iconweuse/icons';
export function ClientOnlyIcon() {
const [mounted, setMounted] = useState(false);
useEffect(() => setMounted(true), []);
if (!mounted) return <div class="w-6 h-6 bg-gray-200 animate-pulse rounded" />;
return <Search />;
}If your webfont icons display excessively large upon page load, the browser might be rendering raw fallback text or symbols before our stylesheet has finished downloading.