So I recently updated my expo SDK from 49 to 51 and created a new development build, but when I tried to run metro I had the error below;
iOS Bundling failed 1653ms
error: node_modulesexpo-router_ctx.ios.tsx: node_modulesexpo-router_ctx.ios.tsx:Invalid call at line 2: process.env.EXPO_ROUTER_APP_ROOT
First argument ofrequire.context
should be a string denoting the directory to require.
I have seen a bunch of solutions online about not including expo-router/babel
in the babel.config then creating a new development build and other solutions that did not work for me.
I am writing this for anyone that might encounter a similar issue. Solution is in the answers.