-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drizzle + postgres not working with bun . Getting error: ResolveMessage #6555
Comments
Hi @Electroid. Could you tell me what the need repro label means ? |
I am also facing the same issue with
|
+1 on this issue. |
I use bun 1.0.7 can confirm not working import { Elysia } from 'elysia';
import { db } from './drizzle.client';
import { test_table } from './index.schema';
(async () => {
const t1 = await db.select().from(test_table);
console.log(t1);
})();
Bun.serve({
fetch(req) {
const url = new URL(req.url);
if (url.pathname === '/') {
return new Response('Home page!');
}
return new Response('404!');
},
}); import { PostgresJsDatabase, drizzle } from 'drizzle-orm/postgres-js';
import postgres from 'postgres';
const client = postgres(process.env.DATABASE_URL as string);
export const db: PostgresJsDatabase = drizzle(client); import { bigserial, pgTable, text } from 'drizzle-orm/pg-core';
export const test_table = pgTable('test', {
id: bigserial('id', { mode: 'number' }).primaryKey().notNull(),
name: text('name').notNull(),
}); |
as suggested changing this to version |
Fixed in v3.4.1 |
Fixed by porsager/postgres#692 |
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
schema.ts
index.ts
.env
setup these 4 files in project root dir.
run
bun run generate
, this will generate a sql file. Execute it create the DB.run
bun run start
.this results in
error: ResolveMessage
rename both
.ts
files to.js
and try running start script.Same issue.
Now edit the start script in
package.json
to use node instead of bun."start": "node index.js "
It works as expected.
Note: I was able to get node working with
ts
also. but adding tsconfigs made the example more verbose.What is the expected behavior?
It should return an empty array.
What do you see instead?
error: ResolveMessage
Additional information
Exact code/setup that works with node does not work with bun.
The text was updated successfully, but these errors were encountered: