Skip to content

Build Error: Module not found: Package path . is not exported from package #10

@euclidesdry-tripee

Description

@euclidesdry-tripee

I'm getting the error:

Image

This is happening because importing the sidebar on SSR is currently impossible. When I try to import from CSR, it returns an error.

My code:

const DynamicSidebar = dynamic(() => import('react-mui-sidebar').then(module => module.Sidebar), {
  ssr: false,
  loading: () => (
    <Stack spacing={2} sx={{ width: sidebarWidth, paddingX: 4, pt: 16 }}>
      <Skeleton height={56} />
      <Skeleton height={56} animation="wave" />
      <Skeleton height={56} />
      <Skeleton height={56} animation="wave" />
      <Skeleton height={56} />
      <Skeleton height={56} animation="wave" />
      <Skeleton height={56} />
    </Stack>
  ),
});

Only the version 1.3.9 of 'react-mui-sidebar' can run with this code on NextJS 14

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions