Module not found: Can’t resolve ‘./RCTNetworking’ in ‘/xxxx/node_modules/react-native/Libraries/Network’

I need help to solve this error when building for web :

Module not found: Can’t resolve ‘./RCTNetworking’ in ‘/xxxx/node_modules/react-native/Libraries/Network’

Initial problem with Platform and other resolve issues were solved by adding aliases in webpack.config.js :

module.exports = async function (env, argv) {
  const config = await createExpoWebpackConfigAsync(env, argv);
  // If you want to add a new alias to the config.
  // config.resolve.alias['moduleA'] = 'moduleB';
  config.resolve.alias["../../Utilities/Platform"] = "react-native-web/dist/exports/Platform";
  config.resolve.alias["../Utilities/Platform"] = "react-native-web/dist/exports/Platform";
  config.resolve.alias["./Platform"] = "react-native-web/dist/exports/Platform";
  config.resolve.alias["./PlatformColorValueTypes"] = "react-native-web/dist/exports/StyleSheet";
  config.resolve.alias["./RCTAlertManager"] = "react-native-web/dist/exports/Alert";

Now the problem is with RCTNetworking, Network is not to be available in react-native-web/dist/exports/Network. so this is not the solution :

config.resolve.alias["./RCTNetworking"] = "react-native-web/dist/exports/Network";

I’ve asked to reopen this issue (as the answer is not clear enough for me) : Field ‘browser’ doesn’t contain a valid alias configuration · Issue #2095 · necolas/react-native-web · GitHub

Any idea ?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.