Reputation: 11
I have an Expo (React Native) app. It works correctly in mobile mode, but if I try to build for web I receive the following error.
Logs for your project will appear below. Press Ctrl+C to exit.
λ Bundling failed 2771ms node_modules\expo-router\node\render.js (2626 modules)
Web Bundling failed 2793ms node_modules\expo-router\entry.js (2565 modules)
Metro error: Unable to resolve module ./Libraries/Image/Image from C:\MyApp\node_modules\react-native\index.js:
None of these files exist:
* node_modules\react-native\Libraries\Image\Image(.web.ts|.ts|.web.tsx|.tsx|.web.js|.js|.web.jsx|.jsx|.web.json|.json|.web.cjs|.cjs|.web.mjs|.mjs|.web.scss|.scss|.web.sass|.sass|.web.css|.css)
* node_modules\react-native\Libraries\Image\Image
124 | },
125 | get Image(): Image {
> 126 | return require('./Libraries/Image/Image');
| ^
127 | },
128 | get ImageBackground(): ImageBackground {
129 | return require('./Libraries/Image/ImageBackground');
Call Stack
<unknown> (node_modules/react-native/index.js)
Web Bundled 166ms node_modules\expo-router\_error.js (126 modules)
I tried reinstalling react-native-web, clearing the cache, and a few other things, but nothing changed.
Do you have any idea how to fix that?
Upvotes: 1
Views: 37