Max Rozen

How to fix: pg-promise can't resolve pg-native

November 17, 2018 • ☕️ 1 min read

I ran into this issue while building the GraphQL resolvers for OnlineOrNot: pg-promise can't resolve pg-native.

Basically when you build for production, Webpack can’t find the pg-native library (which is an optional include!).

The fix is to add new webpack.IgnorePlugin(/^pg-native$/) to your Webpack config’s plugins array:

const webpackConfig = {
  ...
  resolve: { ... },
  plugins: [
    new webpack.IgnorePlugin(/^pg-native$/)
  ]
  output: { ... }
  ...
}

If this post helped you, I'd really appreciate a share on Twitter.


MaxRozen.com

Max Rozen

Thoughts on the Web.
About