AdeleD / react-paginate

A ReactJS component that creates a pagination
MIT License
2.75k stars 626 forks source link

Rendering Error #497

Open josekenya opened 1 year ago

josekenya commented 1 year ago

I'm using this package in a framework and I get this error.

Screenshot 2023-09-12 at 19-18-49 Screenshot

atoi commented 11 months ago

Apparently this package does not feel good when used in ESM project. Worked just fine in Remix project + cjs mode. After switching to esm it started to show the same error as on your screenshot.

SapuSeven commented 3 months ago

I was stuck on the same issue and finally got it to work by following these instructions: https://vike.dev/broken-npm-package#react-invalid-component

The first option ('local workaround') did not work for me, but after installing and configuring the vite-plugin-cjs-interop plugin the pagination component started working.

Not sure if there are alternative ways if you're not using Vite.