Comments (16)
I had the same issue. And I was researching a lot and I found this^
- Go to
node_modules/@react-native-community/cli-server-api/build/statusPageMiddleware.js
- On line 19 wrap process.cwd() to new URL() like this:
new URL(process.cwd())
- Before reload clean cache in
npm using npm cache clean --force
- Run using
npm run start
/npm run android
I hope this will help you too 😇
from cli.
THE PROBLEM IS ONLY IN PATH TO YOUR PROJECT
You can use only latine chars, may also use "-" in naming
If your path to project naming is correct you dont need any ways written higher
But if you need path with not correct chars you may
CHANGE IN FILE node_modules/@react-native-community/cli-server-api/build/statusPageMiddleware.js STRING
res.setHeader('X-React-Native-Project-Root', process.cwd());
TO
res.setHeader('X-React-Native-Project-Root', new URL(process.cwd(), 'file://'));
and always will work (don't forget to clear cache!)
newc URL allow us to make ref to local root file, for example:
for path "/home/user/Рабочий стол" link pathname will be like "'/home/user/%D0%A0%D0%B0%D0%B1%D0%BE%D1%87%D0%B8%D0%B9%20%D1%81%D1%82%D0%BE%D0%BB"
from cli.
I had the same issue. And I was researching a lot and I found this^
- Go to
node_modules/@react-native-community/cli-server-api/build/statusPageMiddleware.js
- On line 19 wrap process.cwd() to new URL() like this:
new URL(process.cwd())
- Before reload clean cache in
npm using npm cache clean --force
- Run using
npm run start
/npm run android
I hope this will help you too 😇
thank you saved my dev day 😊
from cli.
I had the same issue. And I was researching a lot and I found this^
- Go to
node_modules/@react-native-community/cli-server-api/build/statusPageMiddleware.js
- On line 19 wrap process.cwd() to new URL() like this:
new URL(process.cwd())
- Before reload clean cache in
npm using npm cache clean --force
- Run using
npm run start
/npm run android
I hope this will help you too 😇
I got
TypeError: Invalid URL
at new URL (node:internal/url:775:36)
at statusPageMiddleware (/node_modules/@react-native-community/cli-server-api/build/statusPageMiddleware.js:20:48)
``
from cli.
Same here, did you solve it @arnaudambro ?
UPDATE: If anyone else has the same error, please, check your project folder path and confirm there aren´t any special characteres on it. In the example of this issue the path has Arabic characters C:\Users\kikou\OneDrive\المستندات\ReactNative projects\
, same for accents "áéíóú", "àèìòù" or any other non english "çñ..." character. Check this for the full path and then try to build the app again.
from cli.
THE PROBLEM IS ONLY IN PATH TO YOUR PROJECT
You can use only latine chars, may also use "-" in naming
If your path to project naming is correct you dont need any ways written higher
But if you need path with not correct chars you may CHANGE IN FILE node_modules/@react-native-community/cli-server-api/build/statusPageMiddleware.js STRING res.setHeader('X-React-Native-Project-Root', process.cwd()); TO res.setHeader('X-React-Native-Project-Root', new URL(process.cwd(), 'file://'));
and always will work (don't forget to clear cache!)
newc URL allow us to make ref to local root file, for example: for path "/home/user/Рабочий стол" link pathname will be like "'/home/user/%D0%A0%D0%B0%D0%B1%D0%BE%D1%87%D0%B8%D0%B9%20%D1%81%D1%82%D0%BE%D0%BB"
Thank you, this worked for me.
from cli.
Same here, did you solve it @arnaudambro ?
UPDATE: If anyone else has the same error, please, check your project folder path and confirm there aren´t any special characteres on it. In the example of this issue the path has Arabic characters
C:\Users\kikou\OneDrive\المستندات\ReactNative projects\
, same for accents "áéíóú", "àèìòù" or any other non english "çñ..." character. Check this for the full path and then try to build the app again.
Thank you, my path had a non english character
from cli.
the solution provided by @RafikGadzhiyev is correct thanks to him.
from cli.
I had the same issue. And I was researching a lot and I found this^
- Go to
node_modules/@react-native-community/cli-server-api/build/statusPageMiddleware.js
- On line 19 wrap process.cwd() to new URL() like this:
new URL(process.cwd())
- Before reload clean cache in
npm using npm cache clean --force
- Run using
npm run start
/npm run android
I hope this will help you too 😇
Thank you, my problem has been solved
from cli.
O mesmo aqui, você resolveu@arnaudambro?
ATUALIZAÇÃO: Se alguém tiver o mesmo erro, por favor, verifique o caminho da pasta do seu projeto e confirme se não há caracteres especiais nela. No exemplo desta edição o caminho possui caracteres árabes
C:\Users\kikou\OneDrive\المستندات\ReactNative projects\
, o mesmo para acentos "áéíóú", "àèìòù" ou qualquer outro caractere "çñ..." não inglês. Verifique o caminho completo e tente criar o aplicativo novamente.
Sorted out. My path had space between two texts. Space removed and the problem went away.
from cli.
My path looks fine, but I still get an error
TypeError [ERR_INVALID_URL]: Invalid URL
at new NodeError (node:internal/errors:400:5)
at URL.onParseError (node:internal/url:565:9)
at new URL (node:internal/url:645:5)
at statusPageMiddleware (/Users/zhangwencai/qianduan/code/AwesomeProject/node_modules/@react-native-community/cli-server-api/build/statusPageMiddleware.js:19:48)
at call (/Users/zhangwencai/qianduan/code/AwesomeProject/node_modules/connect/index.js:239:7)
at next (/Users/zhangwencai/qianduan/code/AwesomeProject/node_modules/connect/index.js:183:5)
at next (/Users/zhangwencai/qianduan/code/AwesomeProject/node_modules/connect/index.js:161:14)
at next (/Users/zhangwencai/qianduan/code/AwesomeProject/node_modules/connect/index.js:161:14)
at next (/Users/zhangwencai/qianduan/code/AwesomeProject/node_modules/connect/index.js:161:14)
at next (/Users/zhangwencai/qianduan/code/AwesomeProject/node_modules/connect/index.js:161:14)
You can try to move project to another path or try the second way described in my answer higher
from cli.
@bouakram 这个方法也可以解决那个问题2. new URL()
from cli.
deleting the 19 line X-React-Native-Project-Root
from cli.
My path looks fine, but I still get an error
TypeError [ERR_INVALID_URL]: Invalid URL
at new NodeError (node:internal/errors:400:5)
at URL.onParseError (node:internal/url:565:9)
at new URL (node:internal/url:645:5)
at statusPageMiddleware (/Users/zhangwencai/qianduan/code/AwesomeProject/node_modules/@react-native-community/cli-server-api/build/statusPageMiddleware.js:19:48)
at call (/Users/zhangwencai/qianduan/code/AwesomeProject/node_modules/connect/index.js:239:7)
at next (/Users/zhangwencai/qianduan/code/AwesomeProject/node_modules/connect/index.js:183:5)
at next (/Users/zhangwencai/qianduan/code/AwesomeProject/node_modules/connect/index.js:161:14)
at next (/Users/zhangwencai/qianduan/code/AwesomeProject/node_modules/connect/index.js:161:14)
at next (/Users/zhangwencai/qianduan/code/AwesomeProject/node_modules/connect/index.js:161:14)
at next (/Users/zhangwencai/qianduan/code/AwesomeProject/node_modules/connect/index.js:161:14)
from cli.
我的路径看起来不错,但仍然出现错误
TypeError [ERR_INVALID_URL]:
新的 NodeError (node:internal/errors:400:5) 处的URL 无效。新的 URL
(node:internal/url:645:5) 处的 URL.onParseError (
node:internal/url:565:9) 处的 URL 无效
在 statusPageMiddleware (/Users/zhangwencai/qianduan/code/AwesomeProject/node_modules/@react-native-community/cli-server-api/build/statusPageMiddleware.js:19:48)
在电话 (/Users/zhangwencai/qianduan/code ) /AwesomeProject/node_modules/connect/index.js:239:7)
在下一个(/Users/zhangwencai/qianduan/code/AwesomeProject/node_modules/connect/index.js:183:5)
在下一个(/Users/zhangwencai/qianduan) /code/AwesomeProject/node_modules/connect/index.js:161:14)
在下一个(/Users/zhangwencai/qianduan/code/AwesomeProject/node_modules/connect/index.js:161:14)
在下一个(/Users/zhangwencai) /qianduan/code/AwesomeProject/node_modules/connect/index.js:161:14)
在下一个(/Users/zhangwencai/qianduan/code/AwesomeProject/node_modules/connect/index.js:161:14)您可以尝试将项目移动到另一条路径或尝试我的答案中描述的第二种方法
Problem solved, thank you
from cli.
删除第19行X-React-Native-Project-Root
@hw514352 这个方法挺管用的
from cli.
Related Issues (20)
- error index.js: Cannot read properties of undefined (reading 'match'). HOT 1
- How do you set mode with 'react-native start'? HOT 3
- Error on fresh projects in Lauching app in the emulator, RN -v 0.73 - Starting: intent HOT 3
- sdk version problem HOT 1
- Something is trying to use the devDependency 'metro-config' when building a production release build HOT 4
- Fail to download yarn if there is expired GITHUB_TOKEN HOT 4
- Android SDK: Not Found HOT 1
- Project initialization hangs HOT 5
- Failure of pod install for the React Native project using Yarn Berry - Yarn 3.x or 4.x. HOT 3
- Getting Error While initialization react native app in ubuntu HOT 12
- Undeclared identifer in OnLoad.cpp.o HOT 11
- Able to build ios app but unable to get build settings to deplou
- Handle prompts in `init` command HOT 1
- React Native Build Failed After update build.gradle compileSdkVersion=34
- Read main activity from manifest not correctly handling activities with "missing" intent nodes
- How to fix CompileC normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'Pods-urbex' from project 'Pods') failure in react-native ios HOT 1
- Experimental debugger support for custom hostnames HOT 1
- AndroidManifest.xml intent-filter error
- please Help me I can't fix this error HOT 2
- Build Failed HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cli.