Next.js Discord

Discord Forum

Prerendering error - TypeError: (0 , m.kP) is not a function

Unanswered
Transvaal lion posted this in #help-forum
Open in Discord
Transvaal lionOP
Hi, I have an issue building my page, when I use next dev it works but when building it throws errors for all the routes.

Error occurred prerendering page "/auth/register". Read more: https://nextjs.org/docs/messages/prerender-error
TypeError: (0 , m.kP) is not a function
    at p (/vercel/path0/.next/server/chunks/633.js:1:5813)
    at em (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:128334)
    at /vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:140034
    at Array.toJSON (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:143612)
    at stringify (<anonymous>)
    at eE (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:131997)
    at eR (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:132440)
    at AsyncLocalStorage.run (node:async_hooks:338:14)
    at Timeout._onTimeout (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:144064)
    at listOnTimeout (node:internal/timers:569:17)

✓ Generating static pages (10/10) 
> Export encountered errors on following paths:
    /(protected)/dashboard/page: /dashboard
    /(protected)/ideas/page: /ideas
    /(protected)/settings/page: /settings
    /_not-found
    /auth/error/page: /auth/error
    /auth/login/page: /auth/login
    /auth/register/page: /auth/register
    /page: /

6 Replies

Transvaal lionOP
import { RegisterForm } from "@/components/auth/register-form"

const RegisterPage = () => {
  return (
    <div>
      <RegisterForm />
    </div>
  )
}

export default RegisterPage

This is the structure:

   ---(protected)
      ---dashboard
        page.tsx
      ---ideas
        page.tsx
      ---settings
        page.tsx
   ---api
      ---auth
          ---[...nextauth]
            route.ts
   ---auth
       ---error
        page.tsx
       ---login
        page.tsx
       ---register
        page.tsx
I don't understand anything because I revised all the pages and I didn't find anything strange. Please help me!
What does the auth/register/page.tsx look like?
Transvaal lionOP
import { RegisterForm } from "@/components/auth/register-form"

const RegisterPage = () => {
  return (
    <div>
      <RegisterForm />
    </div>
  )
}

export default RegisterPage
just that
Transvaal lionOP
well, i found some warnings about bcrypt:
A Node.js API is used (process.nextTick at line: 274) which is not supported in the Edge Runtime.
Learn more: https://nextjs.org/docs/api-reference/edge-runtime
Import trace for requested module:
./node_modules/bcryptjs/dist/bcrypt.js
./auth.config.ts
./node_modules/bcryptjs/dist/bcrypt.js