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: nodejs support by default #134

Merged
merged 2 commits into from Jan 12, 2023
Merged

fix: nodejs support by default #134

merged 2 commits into from Jan 12, 2023

Conversation

Tymek
Copy link
Member

@Tymek Tymek commented Jan 11, 2023

About the changes

  • Prevent crashing if window is undefined without additional configuration
  • Fix typo in InMemoryStorageProvider

@Tymek Tymek force-pushed the fix/isomorphic-platform branch 2 times, most recently from 81e7f46 to ef19397 Compare January 11, 2023 11:10
Signed-off-by: Tymoteusz Czech <2625371+Tymek@users.noreply.github.com>
@Tymek Tymek requested a review from ivarconr January 12, 2023 11:00
@@ -76,7 +76,7 @@ const storeKey = 'repo';

export const resolveFetch = () => {
try {
if ('fetch' in window) {
if (typeof window !== 'undefined' && 'fetch' in window) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not if(window && 'fetch' in window)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking if window is truthy can still trigger TS error "window is not defined"

@Tymek Tymek merged commit 2fd7282 into main Jan 12, 2023
@Tymek Tymek deleted the fix/isomorphic-platform branch January 12, 2023 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants