Skip to content

Pages router data requests returning 404 when middleware is used #2471

Open
@serhalp

Description

@serhalp

On sites that use pages router and have middleware, loading a page using next/link will attempt to load a JSON file, which will return a 404. If there is no middleware then it works fine. This applies even if the middleware does nothing.

Data

The following is parsed automatically by the Next.js repo e2e test report generator.

test: test/e2e/middleware-base-path/test/index.test.ts
reason: Pages router data requests returning 404 when middleware is used
test case: "Middleware base tests router.query must exist when Link clicked page routing"

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Pages router data requests returning 404 when middleware is used · Issue #2471 · opennextjs/opennextjs-netlify