Omar
Omar3y ago

Electron Import

My developer ran into this error:
No description
9 Replies
jamwt
jamwt3y ago
GitHub
Bundling on nodejs throws (probably types) · Issue #70 · alchemypla...
> node_modules/swarm-js/node_modules/got/index.js:45:28: error: Could not resolve "electron" (mark it as external to exclude it from the bundle, or surround it with try/cat...
Omar
OmarOP3y ago
Yes, I saw this and the fix seems to be updating that netlify config, I didn't know what the correspsonding area for us to edit would be to try the same fix
jamwt
jamwt3y ago
yep, sg. makes sense that electron import isn't working in a server-side context. we'll get back to you soon with some ideas about how to fix this bundler issue within the convex stack
presley
presley3y ago
Yes @Omar Farooq there are two separate things happening here. "web3" import not working (we are looking at it) and "electron" import not working. The "electron" seems to be something you import separately Sorry, forgot to provide update earlier. We have root caused the issue with not being able to import "web3". Working on a fix.
Omar
OmarOP3y ago
Thank you @presley !
presley
presley3y ago
Ok, fix have been deployed to production. The issue was with some node libraries requiring to modify modules they imported via require(), which we didn't allow. I have successfully created an action that imports "web3": "^1.8.1". I haven't actually used the library but should work. Now, we don't see this version of the library depend on electron. So if you keep having issues with the versions and can't upgrade to a newer version, let me know the exact version you are using and I can check out.
Omar
OmarOP3y ago
Fantastic, thank you. We'll use that web3 1.8.1. Really appreciate it!
presley
presley3y ago
(this was just the latest version I got when I ran npm install, so should work with any reasonably new version)
Omar
OmarOP3y ago
@presley Just wanted to confirm web3 is working. Thank you again!

Did you find this page helpful?