While working on a Next.js/React application, you might come across a puzzling error message like this one:
TypeError: resolver is not a function
Fortunately, the solution to this issue is quite simple.
The error typically occurs when the default export of the component for an API call is commented out or missing. To resolve it, ensure that you have a default export for the component.
For example, if you have commented out the default export like this:
// export default <name>
You should uncomment the line and make it look like this:
export default <name>
By ensuring that you have a default export, the TypeError: resolver is not a function
error should no longer appear.
Tags: React, TypeError, resolver, Next.js, API call, default export