I'm using medium-zoom in a server-rendered project, but window / document can only be accessed in client. The differences cause errors when I try to migrate to v1.x from v0.4.0.
If it won't be fixed, I think it is one of the breaking changes that should be listed.
Bug description
In v0.4.0, we only try to access
window
/document
in the function scope, i.e. all related code is wraped in themediumZoom
function:https://github.com/francoischalifour/medium-zoom/blob/8617c954d5690de3c692560e7ddcc02016c232ac/src/medium-zoom.js#L29-L39
In v1.x, we access
window
/document
outside themediumZoom
function:https://github.com/francoischalifour/medium-zoom/blob/e1b85df73d4642fb51f82a21242b24c92ded4005/src/medium-zoom.js#L104-L111
I'm using medium-zoom in a server-rendered project, but
window
/document
can only be accessed in client. The differences cause errors when I try to migrate to v1.x from v0.4.0.If it won't be fixed, I think it is one of the breaking changes that should be listed.