Next.js Discord

Discord Forum

v5 Beta Module does not get found

Unanswered
Asian black bear posted this in #help-forum
Open in Discord
Asian black bearOP
When installing the beta version

pnpm add next-auth@beta 


and runnig the app, the modules do not get found.

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '.../node_modules/.pnpm/next-auth@5.0.0-beta.11_next@14.1.0_react@18.2.0/node_modules/next/server' imported from .../node_modules/.pnpm/next-auth@5.0.0-beta.11_next@14.1.0_react@18.2.0/node_modules/next-auth/lib/env.js
Did you mean to import next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/next/server.js?

Does anyone know what is happening here?

I tried reinstalling, pruning the module, does not seem to work.

// ./pages/api/auth/[...nextauth].ts
import { auth } from "@/auth"


// ./pages/api/auth/route.ts
export {GET, POST} from "@/auth"


// ./auth.ts
import NextAuth from "next-auth"
import ZITADEL from "next-auth/providers/zitadel"

export const {
    handlers: { GET, POST },
    auth,
} = NextAuth({
    providers: [ZITADEL],
})

3 Replies

Asian black bearOP
// package.json
{
  "name": "zitadel",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "next": "14.1.0",
    "next-auth": "5.0.0-beta.11",
    "react": "^18",
    "react-dom": "^18"
  },
  "devDependencies": {
    "@types/node": "^20",
    "@types/react": "^18",
    "@types/react-dom": "^18",
    "autoprefixer": "^10.0.1",
    "eslint": "^8",
    "eslint-config-next": "14.1.0",
    "postcss": "^8",
    "tailwindcss": "^3.3.0",
    "typescript": "^5"
  }
}
Palomino
experiencing same issue
can anyone resolve this?