Skip to content
Discussion options

You must be logged in to vote

Hey , dynamic imports in Next.js with ssr: false can be a bit tricky depending on the component u're importing and how it's being used.

A few things to check:

  1. Is ur component actually a client component?
    If u're using the app directory (/app), make sure ur MyComponent file starts with "use client" — otherwise it won’t run on the client even if u disable SSR.

  2. Try wrapping it in a parent client component
    Sometimes the dynamic import works only if the parent is also marked as a client component. u can try something like:

    "use client";
    import dynamic from "next/dynamic";
    
    const MyComponent = dynamic(() => import("../components/MyComponent"), { ssr: false });
    
    export default function Wrapper(

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Codex1ntech
Comment options

Answer selected by Codex1ntech
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants