Need some help with setting up Express with Next

I'm trying to use Express with Next but it's not working I'm getting this
[nodemon] starting `ts-node --project tsconfig.server.json src/server.ts -- -I`
C:\Users\Aditya\AppData\Local\pnpm\global\5\.pnpm\ts-node@10.9.2_@types+node@20.5.9_typescript@5.5.4\node_modules\ts-node\src\index.ts:859
    return new TSError(diagnosticText, diagnosticCodes, diagnostics);
           ^
TSError: ⨯ Unable to compile TypeScript:
src/server/auth/index.ts:1:31 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("@lucia-auth/adapter-prisma")' call instead.
  To convert this file to an ECMAScript module, change its file extension to '.mts', or add the field `"type": "module"` to 'F:/Projects/Web/temp/test2/package.json'.

1 import { PrismaAdapter } from "@lucia-auth/adapter-prisma";
                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/server/auth/index.ts:2:38 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("lucia")' call instead.
  To convert this file to an ECMAScript module, change its file extension to '.mts', or add the field `"type": "module"` to 'F:/Projects/Web/temp/test2/package.json'.

2 import { Lucia, Session, User } from "lucia";
                                       ~~~~~~~

I've tried changing to .mts .cts nothing works
Here is my ts.server.config
Screenshot_2024-07-28_144743.png
Was this page helpful?