-
-
Notifications
You must be signed in to change notification settings - Fork 227
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
using ES module NPM package #333
Comments
Hey @narasimhajupally, |
I was using the package in the main process which was getting compiled to background.js. the package(execa) is a pure ESM package so in background.js |
Any news here. This has led to us having to drop a lot of Sindreshohus' packages, which are mostly pure ESM. pretty much a showstopper. What needs to be done here? How can we contribute to fix this? |
How big is your ES module? @pixelass Workaround: I did that with ollama-js, I rewrote the module, and have put all functions I need inside the But if the module is too big and difficult to just extract the function you want, I have no solution for you. |
@bm777 Sorry but AFAIK pages/api does not work in production due to export. Anyways whenever I import execa, camelcase or other ESM modules I get an error from background.js and it seems that there is no way to fix it ATM. But thanks anyways. Every idea is welcome. Our current approach is either use native alternatives (child process instead of execa) or boldly copy code into our source (🤮) |
@pixelass when I said I understand, just copying is sometimes copying garbage in our code. |
I am getting an error when I try to use the npm package of
type: "module"
. the package name is execa.require() of ES Module /home/j-_-j/Desktop/eligere/repos/desktop-recorder-app/node_modules/execa/index.js from /home/j-_-j/Desktop/eligere/repos/desktop-recorder-app/app/background.js not supported.
how to fix this ? should I change webpack configuration?
Thanks.
The text was updated successfully, but these errors were encountered: