Skip to content
This repository has been archived by the owner on Dec 26, 2018. It is now read-only.

Apply hotfix to support SSR (Fixes #92) #99

Open
wants to merge 2 commits into
base: next
Choose a base branch
from
Open

Conversation

Kaptard
Copy link

@Kaptard Kaptard commented Sep 19, 2017

Added this direct hotfix for window not being available server-sided. It's been 9 months since the PR for this has been proposed, so I think that 'temporary' fix in the readme should be implemented directly for the time being.

Functionally, this does the same as the proposed readme fix:

  • Puts the Hammer.js import in a try/catch block
  • If an error occurs (-> window is not defined), it assigns an empty stub to Hammer instead

It's not the most beautiful fix, but better than workarounds with webpack that don't work on certain setups.

Kaptard and others added 2 commits September 19, 2017 05:11
Pretty messy, since this should be done in /src/component, however there's no contribution guide laying out the pre-processing steps.
Don't really wanna bother with this too much either, [since it'll (hopefully) get patched on Hammer.js' side soon](hammerjs/hammer.js#1060)
@homerjam
Copy link

+1

2 similar comments
@dr1v3
Copy link

dr1v3 commented Feb 23, 2018

+1

@KevisLuo
Copy link

+1

@MichaelSchober
Copy link

+1

1 similar comment
@marco-gattelli
Copy link

+1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants