react-paginate icon indicating copy to clipboard operation
react-paginate copied to clipboard

Warning - The pageCount prop value provided is not an integer

Open Indranil-R opened this issue 1 year ago • 12 comments

I am using NextJs to create an application. react-paginate throws warning.

(react-paginate): The pageCount prop value provided is not an integer (true). Did you forget a Math.ceil()?

I have tried with const pageCount = (Math.ceil(table?.getPageCount() - 1)); const pageCount = parseInt(Math.ceil(table?.getPageCount() - 1));

console output is console.log(pageCount) number

Still its showing warning.

Indranil-R avatar Aug 05 '23 21:08 Indranil-R

@Indranil-R I want to work on this issue, can you please assign it to me.

AtulPatidar1709 avatar Aug 19 '23 13:08 AtulPatidar1709

@Indranil-R please assign this one to me

alisher-aituarov avatar Aug 20 '23 08:08 alisher-aituarov

use like this

 const pageCosunt = parseInt(Math.ceil(table?.getPageCount() - 1) || 1);

just use a logical OR and add 1 by default.

mdinjamul avatar Sep 19 '23 19:09 mdinjamul

use like this

 const pageCosunt = parseInt(Math.ceil(table?.getPageCount() - 1) || 1);

just use a logical OR and add 1 by default.

Nope, this doesn't help.

Indranil-R avatar Oct 01 '23 20:10 Indranil-R

@Indranil-R I want to work on this issue, can you please assign it to me. @alisher-aituarov

Can I you tell me how to assign it to you? I am not sure how to do it.

Indranil-R avatar Oct 01 '23 20:10 Indranil-R

same issue

stanislavlyu avatar Oct 03 '23 17:10 stanislavlyu

Screenshot 2023-10-03 at 18 31 35 only happens with production build, locally everything working properly. I checked that pageCount is number, i tried put pageCount manually with mock number but result still the same

stanislavlyu avatar Oct 03 '23 17:10 stanislavlyu

we have same issue. Is it relevant that Next.js is version 13.5?

cozynooks avatar Oct 04 '23 06:10 cozynooks

Was having the same issue. Going back to Next.js version 13.5.3 seems to fix this issue in production builds.

esotericbug avatar Oct 04 '23 07:10 esotericbug

Same issue using Next.js v13.5.4. This error only occurs when building the application. In development, it works just fine.

Even when assigning a hard-coded value to pageCount, it still reads (undefined).

Currently, I have downgraded Next.js from v13.5.4 to v13.5.1 to make it work.

andreyfarias avatar Oct 06 '23 12:10 andreyfarias

Seems like we are all having the issue #501

13.5.3 is working fine on a build, so it is something that happened specifically between 13.5.3 and 13.5.4.

Tracking it down further, it happened between 13.5.4-canary.8 (works) and 13.5.4-canary.9 (broken).

camcamcamcam avatar Oct 07 '23 17:10 camcamcamcam

Any fix for this? Has anyone tested in Next.js 14?

theDanielJLewis avatar Dec 01 '23 04:12 theDanielJLewis