You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run pnpm install and pnpm build, this should result in SSR routes. Removing the usage usePathname in the NavLink component, should result in SSG routes (after another pnpm build).
The text was updated successfully, but these errors were encountered:
sdorra
changed the title
Next 13: Usage of usePathname in client component result in SSR instead of SSG on build
Next 13: Usage of usePathname in client component results in SSR route instead of SSG
Nov 3, 2022
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Verify canary release
Provide environment information
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
Usage of a client component which uses the
usePathname
hook results in SSR pages on build.Client Component:
If this component is used, the routes are rendered as SSR:
If i replace the usage of the hook e.g.:
The build renders the routes as SSG:
Expected Behavior
Should render the routes as SSG.
Link to reproduction
https://github.com/sdorra/rick-and-morty
To Reproduce
Run
pnpm install
andpnpm build
, this should result in SSR routes. Removing the usageusePathname
in the NavLink component, should result in SSG routes (after anotherpnpm build
).The text was updated successfully, but these errors were encountered: