Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

pg-cursor cannot be bundled with webpack #41

Open
andreaskundig opened this issue Aug 9, 2018 · 2 comments
Open

pg-cursor cannot be bundled with webpack #41

andreaskundig opened this issue Aug 9, 2018 · 2 comments

Comments

@andreaskundig
Copy link

andreaskundig commented Aug 9, 2018

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:
af84d5c#commitcomment-22901440

@andreaskundig
Copy link
Author

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

@mikl
Copy link
Contributor

mikl commented Dec 4, 2018

You could try this PR: #47

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants