Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pg-native is not found in a monorepo with pnpm or yarn pnpm #281

Closed
vjpr opened this issue May 29, 2021 · 1 comment
Closed

pg-native is not found in a monorepo with pnpm or yarn pnpm #281

vjpr opened this issue May 29, 2021 · 1 comment
Labels

Comments

@vjpr
Copy link

vjpr commented May 29, 2021

  1. It fails silently if you have preferNativeBindings. It should show a warning to stdout.
  2. In pnpm node_modules is not flattened so you need to explcitily declare the peer dep.
  3. There should be the option to pass in the pg-native module. E.g. createPool(uri, {pgModule: require('pg-native')}).
  4. Add a note to the readme.md about it.

Fix:

  "peerDependenciesMeta": {
    "pg-native": {
      "optional": true
    }
  },

Related: #240 #115

Workaround for pnpm

.pnpmfile.cjs

  // See: https://github.com/gajus/slonik/issues/281
  if (pkg.name === 'slonik') {
    pkg.dependencies = {
      ...pkg.dependencies,
      pg: '*',
      'pg-native': '*',
    }
  }
@vjpr vjpr added the bug label May 29, 2021
@gajus gajus closed this as completed in 46f6186 Aug 6, 2021
@gajus
Copy link
Owner

gajus commented Aug 6, 2021

🎉 This issue has been resolved in version 23.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gajus gajus added the released label Aug 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants