Skip to content

hashChangeStart does not fire anymore #26853

@gurkerl83

Description

@gurkerl83

What version of Next.js are you using?

11.0.2-canary.4

What version of Node.js are you using?

12.0.0

What browser are you using?

Chrome, Firefox, Safari

What operating system are you using?

macOS

How are you deploying your application?

next start, Vercel

Describe the Bug

Listening to the routers hashChangeStart event worked in 11.0.1 to initiate smooth-scrolling behavior.
I noticed in initial tests of the latest Canary version that this event is no longer triggered.

Expected Behavior

Fire hashChangeStart when the hash changes

To Reproduce

Local tests show that this problem exists since version 11.0.2-canary.0.

The hashChangeStart event gets not used too often in the project; I looked at the latest changes.

The following commit got merged a couple of days ago, part of canary.0, which causes the problem.

be62f02

I guess that the condition is somehow too specific, blocking from entering.

if (
!(options as any)._h &&
this.onlyAHashChange(cleanedAs) &&
!localeChange
) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue was opened via the bug report template.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions