Skip to content

Commit d36ea58

Browse files
committed
build: instruct next.config to ignore the pg-native and cloudflare
This commit is motivated by the issue occurring when the Postgres client `pg` cannot be read by the Next.js server. See the thread on GitHub discussions for the proper context on the matter: vercel/next.js#50177 (comment)
1 parent aa2da2a commit d36ea58

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

config/next-config/next.config.js

+11
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,15 @@
22
module.exports = {
33
reactStrictMode: true,
44
transpilePackages: ['@louffee/ui', '@louffee/lib'],
5+
// Issue solved by ecumene on this discussion on vercel/next.js's GitHub page:
6+
// https://github.com/vercel/next.js/discussions/50177#discussioncomment-5972779
7+
webpack: (config, { webpack }) => {
8+
config.plugins.push(
9+
new webpack.IgnorePlugin({
10+
resourceRegExp: /^pg-native$|^cloudflare:sockets$/,
11+
}),
12+
)
13+
14+
return config
15+
},
516
}

0 commit comments

Comments
 (0)