Issues with NextJS + Turso + DrizzleORM + LuciaAuth

Hello! I am having issues. I recently have been using the planetscale related libs but since they are sunsetting their hobby tier I switched to turso. I changed all the schemas to match the correct types and whatnot. This is where I connect to my db
// db.js
import { drizzle } from "drizzle-orm/libsql";
import { createClient } from "@libsql/client";
export { default as PermissionInteger, MappedPermissions } from "./permissions";

import * as authSchema from "./schemas/auth";
import * as teamSchema from "./schemas/team";
import * as experienceSchema from "./schemas/experience";
import { DrizzleSQLiteAdapter } from "@lucia-auth/adapter-drizzle";

import * as roblox from "./providers/roblox";

export const connection = createClient({
url: process.env.TURSO_DB_URL!,
authToken: process.env.TURSO_AUTH_TOKEN,
});

export const providers = {
roblox,
};

export const db = drizzle(connection, {
schema: { ...authSchema, ...teamSchema, ...experienceSchema },
});

export const dbAdapter = new DrizzleSQLiteAdapter(
// @ts-ignore
db,
authSchema.session,
authSchema.user
);

export { authSchema, teamSchema, experienceSchema };
// db.js
import { drizzle } from "drizzle-orm/libsql";
import { createClient } from "@libsql/client";
export { default as PermissionInteger, MappedPermissions } from "./permissions";

import * as authSchema from "./schemas/auth";
import * as teamSchema from "./schemas/team";
import * as experienceSchema from "./schemas/experience";
import { DrizzleSQLiteAdapter } from "@lucia-auth/adapter-drizzle";

import * as roblox from "./providers/roblox";

export const connection = createClient({
url: process.env.TURSO_DB_URL!,
authToken: process.env.TURSO_AUTH_TOKEN,
});

export const providers = {
roblox,
};

export const db = drizzle(connection, {
schema: { ...authSchema, ...teamSchema, ...experienceSchema },
});

export const dbAdapter = new DrizzleSQLiteAdapter(
// @ts-ignore
db,
authSchema.session,
authSchema.user
);

export { authSchema, teamSchema, experienceSchema };
Whenever I attempt to build with nextjs I get this entire build log:
7 Replies
Headless
HeadlessOP•8mo ago
I use to be able to build perfectly fine using planetscale/mysql2 drivers and everything only when I switched to this am I now having errors relating to libsql
Huge Letters
Huge Letters•8mo ago
well it seems like nextjs is trying to compile readme files lol so this is either a nextjs or libsql client issue - either something wrong with nextjs build system or libsql client provides incorrect export maybe i dunno
Headless
HeadlessOP•8mo ago
thats what it seemed to me too haha im not sure what to do
Huge Letters
Huge Letters•8mo ago
i would check your nextjs(or webpack?) config first - maybe there is some setting to parse .md files(however your logs also indicate license files to be compiled) and it wasn't properly set up and this issue popped up now if not - i would ask in nextjs repo/discord server first. seems more like their issue than libsql
Headless
HeadlessOP•8mo ago
No description
Headless
HeadlessOP•8mo ago
this is my only webkacp config Anyone? Please 🥲
フランソワ
exclude the .md files from your nextJS build something like this

// next.config.js
module.exports = {
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
config.module.rules.push({
test: /\.md$/,
include: [path.resolve(__dirname, 'node_modules')],
use: 'ignore-loader',
});
return config;
},
};

// next.config.js
module.exports = {
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
config.module.rules.push({
test: /\.md$/,
include: [path.resolve(__dirname, 'node_modules')],
use: 'ignore-loader',
});
return config;
},
};
Want results from more Discord servers?
Add your server