0

I recently started learning React Native. I am following this online tutorial and using the Expo framework.

https://www.youtube.com/watch?v=sm5Y7Vtuihg

However, I am getting an error if I try to run it on the web. On Android, using Expo, it is running fine. I tried to search for the error and installed the 'metro-core"' package but the error remains.

This is the error.

Server Error Cannot find module 'react' Require stack:

  • ..../Apps/React%20Native%20Apps/REACT-NATIVE-SERIES/lesson01/node_modules/expo-router/node/render.js.bundle?platform=web&dev=true&hot=false&transform.engine=hermes&transform.routerRoot=app&resolver.environment=node&transform.environment=node&unstable_transformProfile=hermes-stable
  • ..../Apps/React Native Apps/REACT-NATIVE-SERIES/lesson01/node_modules/@expo/cli/build/src/start/server/getStaticRenderFunctions.js
  • ..../Apps/React Native Apps/REACT-NATIVE-SERIES/lesson01/node_modules/@expo/cli/build/src/start/server/metro/metroErrorInterface.js
  • ..../Apps/React Native Apps/REACT-NATIVE-SERIES/lesson01/node_modules/@expo/cli/build/src/start/server/metro/createServerComponentsMiddleware.js
  • ..../Apps/React Native Apps/REACT-NATIVE-SERIES/lesson01/node_modules/@expo/cli/build/src/start/server/metro/MetroBundlerDevServer.js
  • ..../Apps/React Native Apps/REACT-NATIVE-SERIES/lesson01/node_modules/@expo/cli/build/src/start/server/DevServerManager.js
  • ..../Apps/React Native Apps/REACT-NATIVE-SERIES/lesson01/node_modules/@expo/cli/build/src/start/startAsync.js
  • ..../Apps/React Native Apps/REACT-NATIVE-SERIES/lesson01/node_modules/@expo/cli/build/src/start/index.js
  • ..../Apps/React Native Apps/REACT-NATIVE-SERIES/lesson01/node_modules/@expo/cli/build/bin/cli
  • ..../Apps/React Native Apps/REACT-NATIVE-SERIES/lesson01/node_modules/expo/bin/cli

Another error that I am getting with it is

TypeError: The argument 'path' must be a string, Uint8Array, or URL without null bytes. Received '..../Apps/React Native Apps/REACT-NATIVE-SERIES/\x00node:react' at Object.readFileSync (node:fs:451:42) at getCodeFrame (..../Apps/React Native Apps/REACT-NATIVE-SERIES/lesson01/node_modules/metro/src/Server.js:949:18) at Server._symbolicate (..../Apps/React Native Apps/REACT-NATIVE-SERIES/lesson01/node_modules/metro/src/Server.js:1026:22) at Server._processRequest (..../Apps/React Native Apps/REACT-NATIVE-SERIES/lesson01/node_modules/metro/src/Server.js:419:7) { code: 'ERR_INVALID_ARG_VALUE' }

1 Answer 1

0

I resolve the issue by removing a space between the folder name "React Native Apps". Changed "React_Native_Apps". There should be no space between folder names.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.