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 the metro.config.js
:
const raf = require('raf')
raf.polyfill()
The metro.config.js
may not exist, in this case you can create it according to this expo documentation