InternalError: too much recursion on Firefox
Core Problem
A common issue reported by users is an InternalError: too much recursion error that occurs when using the App Router in Next.js with Firefox.
Solution & Analysis
The problem lies in a bug introduced in Next.js 13.5.6-canary.1, which affects how the App Router handles recursive routes. To reproduce this issue, follow these steps:
Step-by-Step Reproduction
- Install dependencies using
npm installoryarn install. - Run the
devtask usingnpm run devoryarn dev. - Open http://localhost:3000 in Firefox (version 118.0.2).
To fix this issue, you can try updating to the latest stable version of Next.js (13.5.6) instead of using the Canary release.
Code Example
Here's an example of how to update your next.config.js file:
--experimental-appDir flag when running the dev task:
Conclusion
By updating to the latest stable version of Next.js or using the --experimental-appDir flag, you should be able to resolve the InternalError: too much recursion issue on Firefox.