Next.js: problem with Router.push using hash

Created on 20 Aug 2020  路  12Comments  路  Source: vercel/next.js

Bug report

Describe the bug

In my case when i change only hash url using Router.push(localhost:3000/#change) coming from localhost:3000 all stylesheets reload again causing the screen blink and a error in browser console.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Checkout https://github.com/fabinppk/hash-problem
  2. All instructions on readme file.

Screenshots

image

System information

  • OS: Ubuntu 20.04
  • Version of Next.js: 9.5.3-canary.6 or higher
  • Version of Node.js: v12.13.1
bug 3 p0

Most helpful comment

Can y'all test the latest Next.js canary and see if the flash of styles is fixed for you?

All 12 comments

This appears fixed on the latest canary Next.js version!

@Timer The problem still persist. The repository inside description still show the console error in 9.5.3-canary.22.

Will look again.

Just re-confirmed it does not reproduce. Please see https://hash-problem.vercel.app/.

Please provide a demo and video if you can get it to reproduce for you!

I made some tests using https://hash-problem.vercel.app/ and chrome browser, and the problem in console and the screen blink still persist.
Ps: In Mozilla Firefox doesnt happens.

Please, see the video here.

If you need more details, just ask me for it.

Wow, I can't reproduce that at all. Since you can reproduce do you think you could try to send a PR fixing the unhandled promise rejection?

Sure, but i don't know what the solution is. what do I do?

I tried this myself, and only got issues if I went to Chrome's device mode (as a fake iPhone) and IMMEDIATELY spammed the button; however, I only get the error/flash once.

I can reproduce in Chrome but only with DevTools open and "Disable cache" (Network tab) option enabled.

Can y'all test the latest Next.js canary and see if the flash of styles is fixed for you?

@Timer Fixed!! :clap:
I've test using https://hash-problem.vercel.app/, the repository in description and in my personal private repository.

Thank you for all your support about this.

Gonna close this out then!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ematipico picture ematipico  路  66Comments

nvartolomei picture nvartolomei  路  78Comments

Timer picture Timer  路  60Comments

Timer picture Timer  路  87Comments

timneutkens picture timneutkens  路  250Comments