How to set root URL in Metro bundler with Expo

140 views Asked by At

I'm building a React Native app with Expo with web support. I plan to host the web version on a website in a subfolder, e.g.

http://somewebsite/myapp/

I build the web version with Metro bundler, using this command:

npx expo export -p web

Then, I upload files from the dist dir to the myapp folder on the website. However, the app doesn't start, and shows this error in console:

http://somewebsite/bundles/web-cba49510376d833ebedca732d1e69545.js 404 Not Found

I tried setting projectRoot in metro.config.js. That didn't have any effect.

How can I tell the Metro bundler to look for files in http://somewebsite/myapp/ instead?

0

There are 0 answers