© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•15mo ago
NotGura

Vercel Postgres failed to work locally

I tried to use vercel postgres but getting the following error. It is working on the vercel deployment tho.
[0]  ⨯ 262 |             //   if (!newSet.has(issue)) {
[0] 263 |             //     console.error(
[0]  ⨯ 262 |             //   if (!newSet.has(issue)) {
[0] 263 |             //     console.error(
✅ ${displayName} fixed ${issue}
)
[0] 264 |             //   }
[0] 265 |             // }
[0] 266 |             if (relevantIssues.size && throwIssue) {
[0] 267 |                 throw new ModuleBuildError([
[0]                                  ^
[0] error: error - node_modules/node-gyp-build/node-gyp-build.js:22:9
[0] 
[0]   20 |
[0]   21 | function load (dir) {
[0] > 22 |   return runtimeRequire(load.resolve(dir))
[0]      |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[0]   23 | }
[0]   24 |
[0]   25 | load.resolve = load.path = function (dir) {
[0] Module not found
[0] It was not possible to find the requested file.
[0]     Parsed request as written in source code: dynamic
[0]     Path where resolving has started: [project]/node_modules/node-gyp-build/node-gyp-build.js
[0]     Type of request: commonjs request
[0]     Import map: No import map entry
)
[0] 264 |             //   }
[0] 265 |             // }
[0] 266 |             if (relevantIssues.size && throwIssue) {
[0] 267 |                 throw new ModuleBuildError([
[0]                                  ^
[0] error: error - node_modules/node-gyp-build/node-gyp-build.js:22:9
[0] 
[0]   20 |
[0]   21 | function load (dir) {
[0] > 22 |   return runtimeRequire(load.resolve(dir))
[0]      |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[0]   23 | }
[0]   24 |
[0]   25 | load.resolve = load.path = function (dir) {
[0] Module not found
[0] It was not possible to find the requested file.
[0]     Parsed request as written in source code: dynamic
[0]     Path where resolving has started: [project]/node_modules/node-gyp-build/node-gyp-build.js
[0]     Type of request: commonjs request
[0]     Import map: No import map entry


This is my drizzle.config.ts:
import "@/db/envConfig";
import { defineConfig } from "drizzle-kit";

export default defineConfig({
    schema: "./src/db/schema.ts",
    out: "./migrations",
    dialect: "postgresql",
    dbCredentials: {
        url: process.env.POSTGRES_URL!,
        ssl: {
            rejectUnauthorized: false,
        },
    },
});
import "@/db/envConfig";
import { defineConfig } from "drizzle-kit";

export default defineConfig({
    schema: "./src/db/schema.ts",
    out: "./migrations",
    dialect: "postgresql",
    dbCredentials: {
        url: process.env.POSTGRES_URL!,
        ssl: {
            rejectUnauthorized: false,
        },
    },
});


This is the index.ts
import "./envConfig";
import { drizzle } from "drizzle-orm/vercel-postgres";
import * as schema from "./schema";
import { sql } from "@vercel/postgres";

export const db = drizzle(sql, { schema });
import "./envConfig";
import { drizzle } from "drizzle-orm/vercel-postgres";
import * as schema from "./schema";
import { sql } from "@vercel/postgres";

export const db = drizzle(sql, { schema });
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

How to setup vercel/postgres locally
Drizzle TeamDTDrizzle Team / help
15mo ago
Using Vercel Postgres and developing locally
Drizzle TeamDTDrizzle Team / help
3y ago
Connecting to Vercel Postgres
Drizzle TeamDTDrizzle Team / help
3y ago
@vercel/postgres & drizzle update?
Drizzle TeamDTDrizzle Team / help
3y ago