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 badges1 Answer
Reset to default 0I 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.
本文标签:
版权声明:本文标题:android - Cannot find module 'react' React Native - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736664813a1946606.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论