Skip to content

Fast refresh not working properly due to page reload when compiling middleware #31827

Closed
@timfuhrmann

Description

@timfuhrmann

What version of Next.js are you using?

12.0.4

What version of Node.js are you using?

16.13.0

What browser are you using?

Chrome, Safari, Edge

What operating system are you using?

macOS

How are you deploying your application?

next dev

Describe the Bug

Since I don't know the technological background or necessity of the page reload for middleware, I'm not sure if that's something that you have to live with when working with middleware - but any change, like edits made to react components, often trigger a page reload due to the middleware being compiled:

wait - compiling /_middleware (middleware only)...

This becomes especially frustrating when working with getStaticProps.

Expected Behavior

No page reload when applying changes ("Fast Refresh").

To Reproduce

Basic middleware implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    WebpackRelated to Webpack with Next.js.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions