Closed rodrigocezarluz closed 3 months ago
I'm experiencing the same issue. I've checked the example repository (https://github.com/lucia-auth/examples/tree/main) and it's working perfectly. However, in my current repository, I'm encountering the following error:
TypeError: oslo_password__WEBPACK_IMPORTED_MODULE_7__.Argon2id is not a constructor
at signUp (signup/actions.ts:50:34)
44 |
> 45 | const hashedPassword = await new Argon2id().hash(password);
| ^
46 | const id = generateId(15);
47 |
48 | try {
I tried different nextjs configs:
/** @type {import('next').NextConfig} */
const nextConfig = {
// webpack: (config) => {
// config.externals.push("@node-rs/argon2", "@node-rs/bcrypt");
// return config;
// },
experimental: {
serverComponentsExternalPackages: ["oslo"]
},
transpilePackages: ['@vesk/components']
}
module.exports = nextConfig
@rodrigocezarluz Could you solve the issue?
This should be fixed with the latest versions
Error when calling server action in a project using lucia auth.
Steps to reproduce:
export default async function DummyPage() { return (
Dummy Form
); }
"use client";
import { dummy } from "@/lib/actions"; export default function DummyForm() { console.log("DummyForm client"); return (
); }
"use server";
export async function dummy(formData: FormData) { console.log("dummy", formData); }
import { lucia, validateRequest } from "@/lib/auth";
export interface ActionResult { error: string | null; }
export async function dummyAuth( formData: FormData ) { const { session } = await validateRequest(); }