Skip to content

Commit

Permalink
Add stub for pg-native for dashboard (#688)
Browse files Browse the repository at this point in the history
Next.js tries to include pg-native which is a module that uses C++
addons into the webpack build on the server (because we have
transpilePackages)

It errors because it thinks the package will end up on the client, but
it won't so for webpack we will just stub it
  • Loading branch information
junlarsen authored Nov 1, 2023
1 parent ebe2a6a commit 9fe0f34
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"dayjs": "^1.11.10",
"next": "^13.5.6",
"next-auth": "^4.24.4",
"pg-native": "file:./stubs/pg-native",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.47.0",
Expand Down
5 changes: 5 additions & 0 deletions apps/dashboard/stubs/pg-native/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "pg-native",
"private": true,
"main": "pgnative.stub.cjs"
}
1 change: 1 addition & 0 deletions apps/dashboard/stubs/pg-native/pgnative.stub.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = null;

0 comments on commit 9fe0f34

Please sign in to comment.