tailwindlabs / tailwindui-issues

A place to report bugs discovered in Tailwind UI.
234 stars 4 forks source link

Salient navlinks are not scrolling to section when deployed to Netlify #1495

Closed erdemgezer closed 1 year ago

erdemgezer commented 1 year ago

Salient template is using NavLink and MobileNavLink components in the header but they are not scrolling to related sections when it's deployed to Netlify. <NavLink href="#features">Features</NavLink>

I have tried changing scroll and prefetch attributes of the Link but didn't help.

It can be visited at https://idyllic-valkyrie-55aeb8.netlify.app/

bradlc commented 1 year ago

Hey @erdemgezer. This appears to be a bug in Netlify's Next.js runtime. I've opened an issue over on that repo if you want to track it.

You can work around the issue by changing the nav links to use a instead of Link (next/link):

- <Link href={href} ...
+ <a href={href} ...

Also, there appears to be some other bugs which may affect the template as well, such as https://github.com/netlify/next-runtime/issues/2089. You can see that clicking on the "Sign in" nav link causes a full page load. Just something to be aware of if you're deploying on Netlify!

I hope that helps!

erdemgezer commented 1 year ago

Thanks for your support @bradlc. I have switched to static export and everything works well know. Hope they fix the issue and I would go back to SSR.