nikitaeverywhere / react-xmasonry

Simple, minimalistic and featured native masonry layout for React JS.
https://zitros.github.io/react-xmasonry
MIT License
91 stars 12 forks source link

Unable to load in deno #29

Open kyeotic opened 1 year ago

kyeotic commented 1 year ago

When I try loading in deno with import { XMasonry, XBlock } from 'react-xmasonry' I get

Uncaught SyntaxError: The requested module 'react-xmasonry' does not provide an export named 'XBlock' at file:///home/kyeotic/dev/portfolio/src/app/projects/Projects.tsx:2:20

This happens with all of these options (defined in import_map)

nikitaeverywhere commented 1 year ago

Hello! Sure, because react-xmasonry is meant to be used in the browser, within React framework.

What's the use case of using it in deno?

nikitaeverywhere commented 1 year ago

Also: see what's exported.

kyeotic commented 1 year ago

The use case is Server side rendering in remix. Even an empty initial pass would be fine, but it fails to load.

nikitaeverywhere commented 1 year ago

Also: see what's exported.

react-xmasonry exports UMD module. I'm not a deno person (yet) so if you or anyone else have an idea why typical UMD is not imported into deno, I'd be happy to assist.

kyeotic commented 1 year ago

I'm still learning it myself. Usually UMD's, especially loaded through ESM transpilers like https://esm.sh, just work. I'm not sure why this one isn't working 🤷