Studio when using Turso `Error: Cannot find module 'better-sqlite3'`

Error when trying to start Studio and push Error: Cannot find module 'better-sqlite3'
3 Replies
Luiz Benevenuto
Luiz BenevenutoOP14mo ago
This is my config
import type { Config } from 'drizzle-kit'
import * as dotenv from 'dotenv'

dotenv.config()

export default {
schema: './src/lib/database/schema/*',
out: './migrations',
driver: 'turso',
dbCredentials: {
url: process.env.DATABASE_URL ?? '',
authToken: process.env.DATABASE_AUTH_TOKEN ?? ''
},
verbose: true
} satisfies Config
import type { Config } from 'drizzle-kit'
import * as dotenv from 'dotenv'

dotenv.config()

export default {
schema: './src/lib/database/schema/*',
out: './migrations',
driver: 'turso',
dbCredentials: {
url: process.env.DATABASE_URL ?? '',
authToken: process.env.DATABASE_AUTH_TOKEN ?? ''
},
verbose: true
} satisfies Config
And this is my setup
import * as schema from '$lib/database/schema';
import { drizzle } from 'drizzle-orm/libsql';
import { createClient } from '@libsql/client/web';
import { DATABASE_URL, DATABASE_AUTH_TOKEN, ENABLE_DRIZZLE_LOGGER } from '$env/static/private';
import { dev } from '$app/environment';

export const client = createClient({ url: DATABASE_URL, authToken: DATABASE_AUTH_TOKEN });

export const db = drizzle(client, {
schema,
logger: ENABLE_DRIZZLE_LOGGER ? Boolean(ENABLE_DRIZZLE_LOGGER) : dev
});
import * as schema from '$lib/database/schema';
import { drizzle } from 'drizzle-orm/libsql';
import { createClient } from '@libsql/client/web';
import { DATABASE_URL, DATABASE_AUTH_TOKEN, ENABLE_DRIZZLE_LOGGER } from '$env/static/private';
import { dev } from '$app/environment';

export const client = createClient({ url: DATABASE_URL, authToken: DATABASE_AUTH_TOKEN });

export const db = drizzle(client, {
schema,
logger: ENABLE_DRIZZLE_LOGGER ? Boolean(ENABLE_DRIZZLE_LOGGER) : dev
});
Angelelz
Angelelz14mo ago
I suspect you're using bun? Drizzle-kit and the studio hasn't been updated to use bun yet if not, this is a bug, I've seen it somewhere, not sure if it's being tracked though
Luiz Benevenuto
Luiz BenevenutoOP14mo ago
Nope, it is not a bun issue. It does not work even with npm or pnpm
Want results from more Discord servers?
Add your server