Invalid href passed to router error after fresh installed create-next-app

Total
19
Shares

After installed nextjs app on my local machine using create-next-app I get this error in console Invalid href passed to router.

Does anyone know how to solve it?

I try to use to attribute instead of href attribute in Link component’s but it doesn’t help.


Solution

Removing the protocol http or https from the external url fixes this issue

example
https://stackoverflow.com/ should be //stackoverflow.com/

Leave a Reply

Your email address will not be published. Required fields are marked *