Using 'pg' in webpack to Electron return an error trying to requiring pg-native.
See original GitHub issueHi!
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.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:5
- Comments:6
Top Results From Across the Web
webpack import error with node-postgres ('pg'.Client)
The error above was thrown when attempting to run a Cypress test that required the npm package 'pg'. Attempting to install the pg-native...
Read more >cypress-io/cypress - Gitter
My test has some setup code that uses the PG npm package and as such, Cypress is throwing that error when Webpack tries...
Read more >Seeing error Module not found: 'pg-native' in heroku app-Reactjs
How to resolve module not found error in webpack/reactjs app? How to create React App including Web3 using create-react-app? I am getting Module...
Read more >A Comprehensive Guide to Fixing Node-Gyp Issues on Windows
Try running npm install –no-optional to install only the required ... If you try to use a newer version of Python, you'll get...
Read more >missing driver error typeorm - You.com | The search engine you ...
The whole package is built using Webpack, but whenever I try to connect to the ... other modules requiring "server modules" wrapped, like...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Does making
pg/native
part ofexternals
in the webpack configuration work?Seems like this is the actual solution we need, so I’ll close this.