Skip to content

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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