# Error: 'ssr: false' option in dynamic() is not supported in Server Components. Use dynamic() with 'ssr: false' only in Client Components.

- **ID:** `nextjs/dynamic-import-ssr-false-client-component`
- **Domain:** nextjs
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

The dynamic() import with { ssr: false } is used in a Server Component, but this option only works within Client Components because Server Components always render on the server.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Next.js 14.x | active | — | — |
| Next.js 15.x | active | — | — |

## Workarounds

1. **Move the dynamic() import to a Client Component by adding 'use client' at the top of the file. Example: 'use client'; import dynamic from 'next/dynamic'; const MyComponent = dynamic(() => import('./MyComponent'), { ssr: false });** (90% success)
   ```
   Move the dynamic() import to a Client Component by adding 'use client' at the top of the file. Example: 'use client'; import dynamic from 'next/dynamic'; const MyComponent = dynamic(() => import('./MyComponent'), { ssr: false });
   ```
2. **If you cannot convert the parent to a Client Component, create a separate wrapper Client Component that handles the dynamic import, and import that wrapper in your Server Component.** (88% success)
   ```
   If you cannot convert the parent to a Client Component, create a separate wrapper Client Component that handles the dynamic import, and import that wrapper in your Server Component.
   ```
3. **Use next/dynamic without ssr: false and instead handle browser-only code inside a useEffect with a mounted state check.** (75% success)
   ```
   Use next/dynamic without ssr: false and instead handle browser-only code inside a useEffect with a mounted state check.
   ```

## Dead Ends

- **** — The component may rely on browser-only APIs (window, document, etc.) that will crash during server-side rendering. Removing 'ssr: false' without client isolation will cause ReferenceError. (60% fail)
- **** — This is a build-time validation error that occurs before runtime. The framework throws it during module resolution, so try-catch cannot intercept it. (100% fail)
- **** — Server Components do not have access to the window object, and conditional imports in Server Components still attempt to resolve the module during server-side rendering, leading to the same error or different import failures. (80% fail)
