admin管理员组

文章数量:1126116

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

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' }

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' }

Share Improve this question edited 2 days ago WasimSafdar asked 2 days ago WasimSafdarWasimSafdar 1,1323 gold badges17 silver badges43 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 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.

本文标签: