Skip to content
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

Guard references to window on module load #2057

Merged
merged 4 commits into from
Nov 2, 2021
Merged

Conversation

stevehobbsdev
Copy link
Contributor

Changes

Guards some instances of window usage at a module level so that builds in SSR environments (like Next.js) no longer fail just by importing the module.

References

Fixes #2051

Tested using the provided sample repro here, which now successfully builds with these changes in place: https://github.com/zackdotcomputer/auth0-lock-repro

Testing

  • This change adds unit test coverage
  • This change adds integration test coverage
  • This change has been tested on the latest version of the platform/language

Checklist

@stevehobbsdev stevehobbsdev added the review:small Small review label Oct 22, 2021
@stevehobbsdev stevehobbsdev requested a review from a team as a code owner October 22, 2021 10:28
src/i18n.js Show resolved Hide resolved
src/ui/box/header.jsx Outdated Show resolved Hide resolved
@stevehobbsdev stevehobbsdev requested review from lbalmaceda and a team October 27, 2021 10:54
@stevehobbsdev stevehobbsdev linked an issue Nov 2, 2021 that may be closed by this pull request
@stevehobbsdev stevehobbsdev merged commit 44968ea into master Nov 2, 2021
@stevehobbsdev stevehobbsdev deleted the fix/window-ref branch November 2, 2021 14:57
@stevehobbsdev stevehobbsdev mentioned this pull request Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review:small Small review
Projects
None yet
2 participants