-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Using 'pg' in webpack to Electron return an error trying to requiring pg-native. #1138
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
Comments
aaaaaaaaaaand its still not. Nor can I find any workarounds :( |
@rozzzly for workarounds you can comment some lines as I said in the description. |
Does making externals: [
"pg/native",
], |
Just tested @charmander solution with Electron, having suffered from the same issue like @michaeljota, works great! I think this should be noticed in the docs and this issue can be closed. |
As of pg The other thing to keep in mind is that you mustn't run postgres queries from a renderer process. |
Seems like this is the actual solution we need, so I'll close this. |
Hi!
I'm trying to use this bundled with webpack to be used in electron. But it tries to import the pg-native module. I really don't know how to use the native binding in Electron, but at least I would like to be able to use the plain JS driver.
I read #127 and #838, and commenting the lines mentioned here makes the package works, but I see this most like a workarround. The problem it's not gone, just hided.
Thanks!
EDIT: You can test this here
npm run build:electron
Main and Renderer process will be packaged in separated files. The Renderer part will be packaged correctly, but when it tries to bundle the Main part the error will be thrown.
The text was updated successfully, but these errors were encountered: