Closed
Description
Summary
Similar to the issue we ran into here except with using the top level way of defining middleware Next 12.2.0 requires. Middleware functions are executed and run expectedly on prefetches to static routes. But no middleware functions are executed on navigation to dynamic pages, user must refresh the page.
Steps to reproduce
- Go to the Repo Demo
- Navigate to Prefetch Middleware test (static pages)
- Observe cookie creation of
ab-static-*
once navigating to the subpages (most likely will prefetch) - Go back and navigate to Prefetch Middleware test (dynamic pages)
- Observe no cookie creation of
ab-dynamic-*
even when navigating to subpage. - Refresh the subpage and observe cookie creation and rewrite as expected.
Works fine locally on netlify dev
Can a work around removing the matcher
config (preview)
A link to a reproduction repository
https://github.com/JohnGemstone/netlify-plugin-nextjs-middleware
Plugin version
4.12.2
More information about your build
- I am building using the CLI
- I am building using file-based configuration (
netlify.toml
)
What OS are you using?
Mac OS
Your netlify.toml file
`netlify.toml`
[build]
publish = ".next"
[build.environment]
NEXT_USE_NETLIFY_EDGE = "true"
[[plugins]]
package = "@netlify/plugin-nextjs"