Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning - The pageCount prop value provided is not an integer #495

Open
Indranil-R opened this issue Aug 5, 2023 · 12 comments
Open

Warning - The pageCount prop value provided is not an integer #495

Indranil-R opened this issue Aug 5, 2023 · 12 comments

Comments

@Indranil-R
Copy link

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.

@AtulPatidar1709
Copy link

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

@alisher-aituarov
Copy link

@Indranil-R please assign this one to me

@mdinjamul
Copy link

use like this

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

just use a logical OR and add 1 by default.

@Indranil-R
Copy link
Author

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
Copy link
Author

@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.

@stanislavlyu
Copy link

same issue

@stanislavlyu
Copy link

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

@cozynooks
Copy link

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

@esotericbug
Copy link

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

@andreyfarias
Copy link

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.

@camcamcamcam
Copy link

camcamcamcam commented Oct 7, 2023

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).

@theDanielJLewis
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants