Skip to content

Chapter 10: starter pagination.tsx missing allPages variable causes ReferenceError #1316

Description

@SilentSword123456

Before submitting

  • I have searched existing issues to make sure this isn't a duplicate
  • I have completed this chapter and encountered the issue myself

Chapter URL

https://nextjs.org/learn/dashboard-app/adding-search-and-pagination

Issue Type

Missing information

Description

The pagination.tsx starter file for Chapter 10 uses the allPages variable
in its JSX but never defines it. The generatePagination function is already
imported at the top of the file but is never called. The tutorial text shows
a // ... comment in that section without mentioning that this line needs to
be added:

const allPages = generatePagination(currentPage, totalPages);

Without this line, the component immediately throws a ReferenceError and the
app crashes.

Expected vs Actual Behavior

Expected: The pagination component renders correctly after following the
tutorial steps.

Actual: The app crashes with "ReferenceError: allPages is not defined"
because the starter file is missing the allPages variable definition.
There is no mention of this in the tutorial text, so it cannot be fixed
without debugging the error yourself.

Environment (optional)

No response

Screenshots (optional)

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions