-
SummaryI am creating a turborepo with two next.js apps, and a db package that uses drizzle-orm, and api package that uses trpc. I have things set up according to the docs, but when I run the web app (pnpm run dev), it error out with the following error: pg@8.14.1/node_modules/drizzle-orm/node-postgres
│ Package pg can't be external
│ The request pg matches serverExternalPackages (or the defa
│ ult list).
│ The request could not be resolved by Node.js from the proj
│ ect directory.
│ Packages that should be external need to be installed in t
│ he project directory, so they can be resolved from the out
│ put files.
│ Try to install it into the project directory by running np
│ m install pg from the project directory.I have created a repo for the same, https://github.com/adeshgg/ultimate-monorepo/tree/feat/auth-in-api I am new to turborepo, Is there something that I am missing here? Additional informationAlso I get these errors, sometimes:
./node_modules/.pnpm/pg-connection-string@2.7.0/node_modul
│ es/pg-connection-string/index.js:76:70
│ Module not found: Can't resolve 'fs'
│ 74 |
│ 75 | // Only try to load fs if we expect to read from
│ the disk
│ > 76 | const fs = config.sslcert || config.sslkey || con
│ fig.sslrootcert ? require('fs') : null
│ |
│ ^^^^^^^^^^^^^
│ 77 |
│ 78 | if (config.sslcert) {
│ 79 | config.ssl.cert = fs.readFileSync(config.sslcer
│ t).toString()Examplehttps://github.com/adeshgg/ultimate-monorepo/tree/feat/auth-in-api |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Solved it by add hoisting the pg package in
|
Beta Was this translation helpful? Give feedback.
Solved it by add hoisting the pg package in
.npmrcfilepublic-hoist-pattern[]=*pg*