"An unexpected error has occurred." nextjs

Hi there,
I am attempting to deploy my nextjs site to netlify and everything works out until I go to view my website: cognito-project.netlify.com

The site loads and I can see the content for a fraction of a second, then I get “An unexpected error has occurred.”
Looking at the console I see the error:
Super expression must either be null or a function, not undefined.
I’m not sure what that means or what is causing it. This error only appears when I deploy my site to netlify.

The code for the website can be seen here github.com/Cognito-Project/website
My build script for netlify is just npm run export

Thanks in advance!

The only Super I am familiar with is the one that is defined in a Class constructor. I’m not sure what could be causing it in your code. Are you able to reproduce the issue locally?

Unfortunately, I am unable to produce the issue locally, this only happens when my project is deployed to netlify

After a lot of trial and error, I’ve come to the conclusion that react-awsome-button was the source of the error. I haven’t had the time yet to look into why it is, but for now I just won’t use it.
Hopefully, this will save someone a couple of hours :grin:

1 Like

We don’t do anything during the build that you don’t define in your build process. The only thing I can think of that may be different would probably be different versions.

That said, glad you figured things out.