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: { ... }

Discuss on TwitterEdit on GitHub

Enjoyed this post? Receive the next one in your inbox!

I won't send you spam.

Unsubscribe at any time.

Max Rozen

Thoughts on business, software, and marketing by Max Rozen [About]