Skip to content

@netlify/plugin-nextjs 5.9.3 breaks client-side navigation #2756

Open
@aleehedl

Description

@aleehedl

When my Next.js site using pages router has i18n enabled, has middleware and has rewrites, the client-side navigation doesn't work properly for non-default locales (fi) with @netlify/plugin-nextjs version 5.9.3 and 5.9.4.

What happens:

  1. Open https://deploy-preview-4--jovial-salmiakki-51d4db.netlify.app/fi
  2. Hover on link "toinen" and see (in devtools network tab) how 404 is returned in the prefetch
  3. Click on link "toinen" -> a full page reload happens

What I expected to happen:

  • In step 2 I expect the prefetch to return the page props instead of 404.
  • In step 3 I expect the client-side navigation to work.

If you switch to the default locale (English) the same does not happen. Also, when you downgrade to plugin version 5.9.2 the problem disappears: https://deploy-preview-3--jovial-salmiakki-51d4db.netlify.app/fi

Minimal reproduction repository here:
https://github.com/aleehedl/netlify-next-plugin-error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions