Change8
Error1 reports

Fix CustomApiError

in Next.js

Solution

CustomApiError often arises in Next.js due to multiple instances of the same error class being created across different bundles or environments (server vs. client), causing `instanceof` checks to fail. Ensure your custom error class is defined in a single, shared module and is imported from the same absolute path consistently throughout your application, which will prevent module duplication and restore proper `instanceof` behavior. Consider using a bundler analyzer to identify and eliminate duplicate modules if necessary.

Timeline

First reported:Dec 22, 2025
Last reported:Dec 22, 2025

Need More Help?

View the full changelog and migration guides for Next.js

View Next.js Changelog