Next.js Discord

Discord Forum

Nextjs DuckDB connection

Unanswered
Hackberry nipple gall parasitoid posted this in #help-forum
Open in Discord
Hackberry nipple gall parasitoidOP
Hi everyone I'm developing apps with nextjs but I have a connection problem. How can i solve this issue?

//api/dbCheck
import { Connection, Database } from "duckdb-async";
import path from "path";

export async function GET() {
     const dbPath = path.join(process.cwd(), "duckdb.db");
      console.log(dbPath);  
      async function simpleTest() {
   
      const db = await Database.create(dbPath);
     
      console.log(db.connect());
      }
      
      simpleTest();
  return Response.json({ message: "Hello, Next.js!" });
}


⨯ ./node_modules/@mapbox/node-pre-gyp/lib/util/s3_setup.js:43:1
Module not found: Can't resolve 'mock-aws-s3'

https://nextjs.org/docs/messages/module-not-found

Import trace for requested module:
./node_modules/@mapbox/node-pre-gyp/lib/node-pre-gyp.js
./node_modules/duckdb/lib/duckdb-binding.js
./node_modules/duckdb/lib/duckdb.js
./node_modules/duckdb-async/dist/duckdb-async.js
./src/app/api/dbCheck/route.ts
 GET /api/dbCheck 500 in 34ms

0 Replies