#Strange error after building

7 messages · Page 1 of 1 (latest)

white meteor
#

hiya, i've just made changes to my Next.js project and everything seemed to be going well until i built the website and got the following error:

Error occurred prerendering page "/". 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: undefined.
    at nM (/Users/mae/Documents/Code/Projects/website/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:61599)
    at nM (/Users/mae/Documents/Code/Projects/website/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:61546)
    at nN (/Users/mae/Documents/Code/Projects/website/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:64546)
    at nB (/Users/mae/Documents/Code/Projects/website/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:67538)
    at nD (/Users/mae/Documents/Code/Projects/website/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:66680)
    at nN (/Users/mae/Documents/Code/Projects/website/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:64853)
    at nB (/Users/mae/Documents/Code/Projects/website/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:67538)
    at nM (/Users/mae/Documents/Code/Projects/website/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:60046)
    at nN (/Users/mae/Documents/Code/Projects/website/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:64546)
    at nB (/Users/mae/Documents/Code/Projects/website/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:67538)
 ✓ Generating static pages (18/18)

> Export encountered errors on following paths:
        /(main)/page: /

this error dosen't occur when previewing the website in dev and i'm not sure what could be causing this. any advice? the /(main)/page page is attached

drowsy owlBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

white meteor
#

the only things i've done between before and now is run bun upgrade and upgrade nextjs, but vscode isn't showing any issues with any files

opal frigate
#

Check the Custom <Tool> component error message mentions an issue related to an undefined component type

#

Check if it's correctly imported

white meteor
#

Oh wtf, I moved it back to a regular import instead of a dynamic one and it just started working again! cant even remember why i had it as dynamic in the first place! thank you dootLove

drowsy owlBOT
#
✅ Success!

This question has been marked as answered! If you have any other questions, feel free to create another post

Jump to answer

[Click here](#1231182701382602784 message)