#Critical dependency warning using Vercel Postgres/server action?

13 messages · Page 1 of 1 (latest)

silver orbit
#

Hi, currently migrating from pages router to app router (it's super sick) and have run into this strange warning. Upon rendering my SSR(?) page, no matter where or how I import my database module using @vercel/postgres, the following warning comes up:

○ Compiling / ...                                                                                                                                                                                
 ⚠ ./node_modules/node-gyp-build/index.js                                                                                                                                                         
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted                                                                                       
                                                                                                                                                                                                  
Import trace for requested module:
./node_modules/node-gyp-build/index.js
./node_modules/utf-8-validate/index.js
./node_modules/ws/lib/validation.js
./node_modules/ws/lib/sender.js
./node_modules/ws/wrapper.mjs
./node_modules/@vercel/postgres/dist/index-node.js
./src/server/database.ts
./src/app/page.tsx

Here's my code, any way to remedy this?

oak pelicanBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

silver orbit
#

Bump.

silver orbit
#

Bump.

scenic trench
#

I'm also looking for a solution to something similar to this, working through the Next JS tutorial. Get almost the exact same error, caused by the exact same thing it seems (trying to run queries on my postgres database).

Don't have a solution but here's a free bump 👍

silver orbit
#

Bump.

stray tangle
#

Getting a nearly identical issue; no resolution either

silver orbit
#

Right, I'm seeing that this is a common issue and there's no resolution. I'll see if I can't simply reproduce this and if I can, will make an issue.

stray tangle
#

Did you make an issue @silver orbit ?

silver orbit
#

Haven't had the time as of recent, will sort today though.

silver orbit
#

🤔

stray tangle
#

I've been using Next 14.0.3, which version were you using?