This error prevented me from building my expo app for web (npx expo export -p web)
It seems this error only happens in expo SDK 49+
Here is a screenshot of the console logs, has you see stack trace is of no help at all:
Other than that I am using the default metro config.

I finally found the solution after some days of work .
I just needed to
npm install raf(requestAnimationFrame polyfill) and add those two lines to themetro.config.js:The
metro.config.jsmay not exist, in this case you can create it according to this expo documentation