Reputation: 61
I'm trying to run my expo react native app in web, but i'm getting this error:
Unable to resolve module ../Utilities/Platform from C:app\frontend\frontend\node_modules\react-native\Libraries\ReactNative\PaperUIManager.js:
None of these files exist:
17 | const Platform = require('../Utilities/Platform'); | ^ 18 | const UIManagerProperties = require('./UIManagerProperties'); 19 | 20 | const viewManagerConfigs: {[string]: any | null} = {};
Call Stack MetroBundlerDevServer.getStaticResourcesAsync (node_modules/@expo/cli/build/src/start/server/metro/MetroBundlerDevServer.js) process.processTicksAndRejections (node:internal/process/task_queues) async MetroBundlerDevServer.getStaticPageAsync (node_modules/@expo/cli/build/src/start/server/metro/MetroBundlerDevServer.js) async (node_modules/@expo/cli/build/src/start/server/metro/MetroBundlerDevServer.js)
i have already defined a webpack.config.js and added config.resolve.alias['../Utilities/Platform'] = 'react-native-web/dist/exports/Platform';
tried to check find the package in the modules and solve the problem but wasnt a sucess, tried to create the webpack config using expo customize:web but nothing changed
Upvotes: 6
Views: 1565
Reputation: 37
I had the same problem today. I checked out my git repository step by step and found an import that was causing the issue for me.
import NativeSafeAreaView from "react-native-safe-area-context/src/specs/NativeSafeAreaView";
After I removed this import and stopped using it in my code, the error message disappeared. Hope it will helps
Upvotes: 1