node-pg-cursor icon indicating copy to clipboard operation
node-pg-cursor copied to clipboard

pg-cursor cannot be bundled with webpack

Open andreaskundig opened this issue 7 years ago • 2 comments

I get this error with webpack 4.16.5:

    ERROR in ./node_modules/pg-cursor/pg.js
    Module not found: Error: Can't resolve 'pg.js/lib/result.js' in 'C:\Users\Andreas\workspace\ubiq_reports\server\node_modules\pg-cursor'
     @ ./node_modules/pg-cursor/pg.js 8:26-56
     @ ./node_modules/pg-cursor/index.js
     @ ./report_main.js
     @ multi ./report_main.js

This problem has been around for a while, as this comment from 2017 attests: https://github.com/brianc/node-pg-cursor/commit/af84d5cd4bde99981ebef291fcf7da3d446722da#commitcomment-22901440

andreaskundig avatar Aug 09 '18 08:08 andreaskundig

I made it work by setting webpack.config.js to ignore pg.js, in the same way I had to tell it to ignore pg-native.

    output: {...},
    plugins: [
        new webpack.IgnorePlugin(/^pg-native$/),
        new webpack.IgnorePlugin(/^pg.js.*/)
    ],
   module: {...}

andreaskundig avatar Aug 09 '18 08:08 andreaskundig

You could try this PR: #47

mikl avatar Dec 04 '18 23:12 mikl