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

fix(network): Don't add window event listeners if there is no window #678

Merged
merged 2 commits into from
Nov 2, 2021

Conversation

jcesarmobile
Copy link
Member

If network plugin is imported in SSR context, it fails to compile because window is not available on SSR, so add a window check before adding the event listeners

closes #669

@Ionitron Ionitron added this to Needs review 🤔 in Capacitor Engineering ⚡️ Nov 2, 2021
@jcesarmobile jcesarmobile merged commit 0c65780 into main Nov 2, 2021
Capacitor Engineering ⚡️ automation moved this from Needs review 🤔 to Done 🎉 Nov 2, 2021
@jcesarmobile jcesarmobile deleted the network-no-window branch November 2, 2021 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

@capacitor/network import results in "ReferenceError: window is not defined"
2 participants