Can yet-another-react-lightbox be used in an Electron.js app? #152
-
The YARL demos/examples and API look great, exactly what I need in my Electron.js app. I'm using Node 18.16.1, React 18.2.0, Electron 25.1.1, Babel 7.6.0 (I'm happy to upgrade Babel if that will help). Unfortunately, best info I've been able to find, Electron won't support ESMs until version 27 is available. I studied this discussion and concluded that I should be able to use YARL in an Electron app, even though YARL is ESM-only. If I understand correctly, I should be able to use dynamic imports to import YARL and its plugins. I added an exclusion in my babel.config.js to prevent Babel from converting dynamic imports. This is my babel.config.js:
In one of my components, I added this code to import YARL:
The project builds and I have verified that the above import code is copied unmodified to Babel's output. When I run, though, it just hangs - nothing happens, except Chrom DevTools gives the dreaded "Devtools was disconnected from the page" message. I updated my start script to Surely I'm missing something! How can I use YARL in my Electron app? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Hi there! Based on my research, modern Electron toolkits / boilerplates handle 3rd-party ESM packages with no additional configuration, and YARL works out of the box. Here are Electron toolkits I tested and confirmed YARL working with no issues: I hope this helps! |
Beta Was this translation helpful? Give feedback.
Hi there!
Based on my research, modern Electron toolkits / boilerplates handle 3rd-party ESM packages with no additional configuration, and YARL works out of the box.
Here are Electron toolkits I tested and confirmed YARL working with no issues:
I hope this helps!