react-layout-masonry throwing error with next@latest
Unanswered
Black Caiman posted this in #help-forum
Black CaimanOP
I'm using a package for masonry grid to display images.
https://www.npmjs.com/package/react-layout-masonry
While running, it's throwing error.
Logs:
Can you guys suggest any better package that actually works with next 13 or something.
It's not even getting build due to this.
https://www.npmjs.com/package/react-layout-masonry
While running, it's throwing error.
Logs:
✓ Compiled /favicon.ico/route in 160ms (1121 modules)
✓ Compiled in 7.6s (2266 modules)
âš Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/messages/fast-refresh-reload
⨯ node_modules/react-layout-masonry/dist/index.js (1:234) @ E
⨯ Internal error: ReferenceError: window is not defined
at E (./node_modules/react-layout-masonry/dist/index.js:9:73)
at _ (./node_modules/react-layout-masonry/dist/index.js:9:539)
at B (./node_modules/react-layout-masonry/dist/index.js:9:742)Can you guys suggest any better package that actually works with next 13 or something.
It's not even getting build due to this.
1 Reply
Black CaimanOP
Btw Issue resolved.
Correct package: https://www.npmjs.com/package/react-plock
### Sources:
- https://github.com/askides/react-plock
- https://github.com/iammatthias/com/blob/main/src/app/components/masonry/index.tsx
- https://www.reddit.com/r/nextjs/comments/rtlj8h/help_me_create_masonry_image_gallery_with_image/
Correct package: https://www.npmjs.com/package/react-plock
### Sources:
- https://github.com/askides/react-plock
- https://github.com/iammatthias/com/blob/main/src/app/components/masonry/index.tsx
- https://www.reddit.com/r/nextjs/comments/rtlj8h/help_me_create_masonry_image_gallery_with_image/