Next.js Discord

Discord Forum

Link tag broken when using Safari

Unanswered
Willow Ptarmigan posted this in #help-forum
Open in Discord
Willow PtarmiganOP
Hi there,

I will describe the behavior of the Link component. When I open the deployed NextJS website on Safari (either on my Mac or iPhone), I click on the link and it takes me to the desired page properly. However, if I use the browser "Back" button, it takes me back to the previous page, but if I click the exact same button that is supposed to take me to the desired page, nothing happens.

This only happens with absolute urls: such as https://app.mydomain.com. This does not happen in my local development environment, only when deployed to Vercel. What could be the issue or what could be a fix for this? I wouldn't want to use a basic "a" tag.

<Link
            className="mt-5"
            href={'${process.env.NEXT_PUBLIC_ROOT_PROTOCOL}app.${process.env.NEXT_PUBLIC_ROOT_DOMAIN}/${lang}/register'}
          >
            <GradientButton>{dict.home.heroCTA}</GradientButton>
          </Link>



NEXT_PUBLIC_ROOT_PROTOCOL = https://
NEXT_PUBLIC_ROOT_DOMAIN = mydomain.com

4 Replies

Willow PtarmiganOP
bump
Willow PtarmiganOP
bump
Willow PtarmiganOP
bump
Toyger
don't update question too often, maximum once a day.
bug still unsolved.
https://github.com/vercel/next.js/issues/62015
if it happens with external url, you can make some route handler either page that will redirect to external location, and put then it inside your link