Issue running migrate(): error: script "migrate" exited with code 1 (SIGHUP)

I am trying to run my migration script that should execute my migration sql files:
import { drizzle } from 'drizzle-orm/postgres-js';
import { migrate } from 'drizzle-orm/postgres-js/migrator';
import postgres from 'postgres';

async function main() {
const sql = postgres(process.env.PRIVATE_DATABASE_URL ?? '', { max: 1 });
const db = drizzle(sql);
await migrate(db, { migrationsFolder: './drizzle' });
}

main()
.catch((err) => {
console.error(err);
process.exit(1);
})
.then(() => {
process.exit(0);
});
import { drizzle } from 'drizzle-orm/postgres-js';
import { migrate } from 'drizzle-orm/postgres-js/migrator';
import postgres from 'postgres';

async function main() {
const sql = postgres(process.env.PRIVATE_DATABASE_URL ?? '', { max: 1 });
const db = drizzle(sql);
await migrate(db, { migrationsFolder: './drizzle' });
}

main()
.catch((err) => {
console.error(err);
process.exit(1);
})
.then(() => {
process.exit(0);
});
But I get this error:
$ bun src/lib/server/database/migrate.ts
ResolveMessage {
stack: "undefined",
query: undefined,
parameters: undefined,
args: [],
types: null,
code: undefined,
importKind: undefined,
level: undefined,
message: undefined,
position: undefined,
referrer: undefined,
specifier: undefined,
toJSON: [Function: toJSON],
toString: [Function: toString],
name: "ResolveMessage",
[Symbol(Symbol.toPrimitive)]: [Function: toPrimitive]
}
error: script "migrate" exited with code 1 (SIGHUP)
$ bun src/lib/server/database/migrate.ts
ResolveMessage {
stack: "undefined",
query: undefined,
parameters: undefined,
args: [],
types: null,
code: undefined,
importKind: undefined,
level: undefined,
message: undefined,
position: undefined,
referrer: undefined,
specifier: undefined,
toJSON: [Function: toJSON],
toString: [Function: toString],
name: "ResolveMessage",
[Symbol(Symbol.toPrimitive)]: [Function: toPrimitive]
}
error: script "migrate" exited with code 1 (SIGHUP)
5 Replies
thomasmol
thomasmolOP15mo ago
the weird thing is that this is a copied repo, and in the original repo the script does execute normally. any ideas?
Angelelz
Angelelz15mo ago
This is a known bun/postgres issue
Angelelz
Angelelz15mo ago
GitHub
Drizzle + postgres not working with bun . Getting error: ResolveMes...
What version of Bun is running? 1.0.6 What platform is your computer? Darwin 21.6.0 x86_64 i386 What steps can reproduce the bug? package.json { "name": "drizzlebuntest", "...
Angelelz
Angelelz15mo ago
GitHub
error: ResolveMessage after upgrade to v 3.4.0 · Issue #692 · porsa...
Runtime : bun 1.0.4+745b6b94ee56cad24d475799690cc9a89957d15b Updating Postgres.js from 3.3.5 to 3.4.0, but then I got an error: ResolveMessage when executing a query. ResolveMessage { stack: "...
thomasmol
thomasmolOP15mo ago
ahh okay, thx so much!
Want results from more Discord servers?
Add your server