Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve error handling in compatibility mode
We automatically ‘enable’ compatibility mode if the file app/v6/routes.js exists. We currently do this by including it within a try/catch block, relying on the empty catch block handling the case where the file does not exist. However this means that if any exception is encountered whilst requiring that file, we silently fail and do not enable compatibility mode. This means that if e.g. a user’s v6 routes file includes a dependency which is not installed (which is likely if the user is trying to update their prototype, as doing so nukes any additional dependencies in their package.json file) then this error will not be reported and compatibility mode just won’t work. Instead, we test for the presence of app/v6/routes.js – if it exists, then we require it. If any exception is encountered in doing so, it’ll be thrown as expected. Fixes #799
- Loading branch information