Next.js Discord

Discord Forum

Error: Element type is invalid: expected a string (for built-in components) or a class/function (for

Answered
gin posted this in #help-forum
Open in Discord
Avatar
ginOP
Please i need help, someone??
Answered by gin
turns out downgrading to 14.1.1 resolves the issue
View full answer

7 Replies

Avatar
ginOP
   Creating an optimized production build ...
 ✓ Compiled successfully
 ✓ Linting and checking validity of types
 ✓ Collecting page data
   Generating static pages (9/17)  [=   ]Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
    at nM (C:\Users\steam\Desktop\YG\yg-holyapply\node_modules\next\dist\compiled\next-server\app-page.runtime.prod.js:12:61599)
    at nM (C:\Users\steam\Desktop\YG\yg-holyapply\node_modules\next\dist\compiled\next-server\app-page.runtime.prod.js:12:61546)
    at nN (C:\Users\steam\Desktop\YG\yg-holyapply\node_modules\next\dist\compiled\next-server\app-page.runtime.prod.js:12:64546)
    at nB (C:\Users\steam\Desktop\YG\yg-holyapply\node_modules\next\dist\compiled\next-server\app-page.runtime.prod.js:12:67538)
    at nD (C:\Users\steam\Desktop\YG\yg-holyapply\node_modules\next\dist\compiled\next-server\app-page.runtime.prod.js:12:66680)
    at nN (C:\Users\steam\Desktop\YG\yg-holyapply\node_modules\next\dist\compiled\next-server\app-page.runtime.prod.js:12:64853)
    at nB (C:\Users\steam\Desktop\YG\yg-holyapply\node_modules\next\dist\compiled\next-server\app-page.runtime.prod.js:12:67538)
    at nM (C:\Users\steam\Desktop\YG\yg-holyapply\node_modules\next\dist\compiled\next-server\app-page.runtime.prod.js:12:58560)
    at nN (C:\Users\steam\Desktop\YG\yg-holyapply\node_modules\next\dist\compiled\next-server\app-page.runtime.prod.js:12:64546)
    at nB (C:\Users\steam\Desktop\YG\yg-holyapply\node_modules\next\dist\compiled\next-server\app-page.runtime.prod.js:12:67538) {
  digest: '555703619'
}
   Generating static pages (15/17)  [==  ]
Error occurred prerendering page "/settings". Read more: https://nextjs.org/docs/messages/prerender-error

Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
    at nM (C:\Users\steam\Desktop\YG\yg-holyapply\node_modules\next\dist\compiled\next-server\app-page.runtime.prod.js:12:61599)
    at nM (C:\Users\steam\Desktop\YG\yg-holyapply\node_modules\next\dist\compiled\next-server\app-page.runtime.prod.js:12:61546)
    at nN (C:\Users\steam\Desktop\YG\yg-holyapply\node_modules\next\dist\compiled\next-server\app-page.runtime.prod.js:12:64546)
    at nB (C:\Users\steam\Desktop\YG\yg-holyapply\node_modules\next\dist\compiled\next-server\app-page.runtime.prod.js:12:67538)
    at nD (C:\Users\steam\Desktop\YG\yg-holyapply\node_modules\next\dist\compiled\next-server\app-page.runtime.prod.js:12:66680)
    at nN (C:\Users\steam\Desktop\YG\yg-holyapply\node_modules\next\dist\compiled\next-server\app-page.runtime.prod.js:12:64853)
    at nB (C:\Users\steam\Desktop\YG\yg-holyapply\node_modules\next\dist\compiled\next-server\app-page.runtime.prod.js:12:67538)
    at nM (C:\Users\steam\Desktop\YG\yg-holyapply\node_modules\next\dist\compiled\next-server\app-page.runtime.prod.js:12:58560)
    at nN (C:\Users\steam\Desktop\YG\yg-holyapply\node_modules\next\dist\compiled\next-server\app-page.runtime.prod.js:12:64546)
    at nB (C:\Users\steam\Desktop\YG\yg-holyapply\node_modules\next\dist\compiled\next-server\app-page.runtime.prod.js:12:67538)
 ✓ Generating static pages (17/17)

> Export encountered errors on following paths:
        /settings/page: /settings
i dont really have a good place to start debugging
anyone knows why this maybe happens
i didnt change anything in /settings
and everything works on next dev
Avatar
Taiwan Dog
also have the same error
Avatar
ginOP
turns out downgrading to 14.1.1 resolves the issue
Answer