Next.js Discord

Discord Forum

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of URL

Unanswered
Asian black bear posted this in #help-forum
Open in Discord
Asian black bearOP
I'm trying to use database library, monstrous (https://gitlab.com/monstrous/monstrous). Here is my code:
// FILE: db.ts
import monstrous from "monstrous";
const db = monstrous({
host: "localhost",
port: 5432,
database: "dvdrental",
user: "postgres",
password: "postgres",
scripts: "lib/sql",
});
export default db;

FILE: page.tsx
import db from "./db";
console.log({ db });

It gives stack trace as attached.

I tried same code in Node.js/Express.js with JavaScript, it works fine.

1 Reply

Asian black bearOP
@Siberian