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

Feature: ability to use panzoom with SSR #499

Closed
maximbukanov opened this issue Jul 21, 2020 · 4 comments
Closed

Feature: ability to use panzoom with SSR #499

maximbukanov opened this issue Jul 21, 2020 · 4 comments

Comments

@maximbukanov
Copy link

What problem does this feature solve?
This feature solves crashes of next.js (or any other SSR app) on dev & build modes

Describe the solution you'd like
Try to check typeof of window or use exenv's canUseDom utility

Additional context
Here comes the log output of npm run dev inside next.js app
log.txt

@timmywil
Copy link
Owner

Thanks for opening an issue. It makes sense to be able to load it without having to dynamically load it so I'll add the window checks, but you should still only initialize Panzoom on the front-end, such as in a componentDidMount.

@timmywil
Copy link
Owner

By the way, this is how you would include something like panzoom in next.js: https://nextjs.org/docs/advanced-features/dynamic-import#with-no-ssr

But this shouldn't be necessary once I finish the patch.

@maximbukanov
Copy link
Author

Thanks for the answer! I see that you've just applied the fix for this issue. Have you deployed it to npm?

timmywil added a commit that referenced this issue Jul 21, 2020
## [4.3.1](4.3.0...4.3.1) (2020-07-21)

### Bug Fixes

* check for window and document to allow ssr loading ([3a0119e](3a0119e)), closes [#499](#499)
@timmywil
Copy link
Owner

🎉 This issue has been resolved in version 4.3.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

timmywil added a commit that referenced this issue Aug 6, 2020
## [4.3.1](4.3.0...4.3.1) (2020-07-21)

### Bug Fixes

* check for window and document to allow ssr loading ([3a0119e](3a0119e)), closes [#499](#499)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants