-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(Masthead): add optional chaining to root.location to remove error in NextJS when rendering server-side #7681
fix(Masthead): add optional chaining to root.location to remove error in NextJS when rendering server-side #7681
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Deploy preview created for package Built with commit: 28171b10f4aa8c68bb039541ebe1e3c3567aeacc |
Deploy preview created for package Built with commit: 28171b10f4aa8c68bb039541ebe1e3c3567aeacc |
Deploy preview created for package Built with commit: 28171b10f4aa8c68bb039541ebe1e3c3567aeacc |
Deploy preview created for package Built with commit: 28171b10f4aa8c68bb039541ebe1e3c3567aeacc |
Deploy preview created for package Built with commit: 28171b10f4aa8c68bb039541ebe1e3c3567aeacc |
Deploy preview created for package Built with commit: 28171b10f4aa8c68bb039541ebe1e3c3567aeacc |
Deploy preview created for package Built with commit: 28171b10f4aa8c68bb039541ebe1e3c3567aeacc |
Related Ticket(s)
DotcomShell component L1 not working #7678
Description
When setting up DotcomShell with L1 in NextJS template, adopter is running into an error specifically with
const currentUrlPath = root.location.href;
. Seems like NextJS is trying to load it server-side and throws an error thatroot.location
is undefined. Adding optional chaining resolves this issue.Changelog
Changed
currentUrlPath