-
Notifications
You must be signed in to change notification settings - Fork 904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid character in header content #2449
Comments
hey @m1duza, could you please try applying this diff to diff --git forkSrcPrefix/packages/cli-server-api/src/statusPageMiddleware.ts forkDstPrefix/packages/cli-server-api/src/statusPageMiddleware.ts
index 3e98f2b2b46c6401bb3630c746787aec1b8dac3c..2417950d2bf0b88398d2441c6f8484cacddf8900 100644
--- forkSrcPrefix/packages/cli-server-api/src/statusPageMiddleware.ts
+++ forkDstPrefix/packages/cli-server-api/src/statusPageMiddleware.ts
@@ -5,6 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
import http from 'http';
+import path from 'path';
/**
* Status page so that anyone who needs to can verify that the packager is
@@ -14,6 +15,7 @@ export default function statusPageMiddleware(
_req: http.IncomingMessage,
res: http.ServerResponse,
) {
- res.setHeader('X-React-Native-Project-Root', process.cwd());
+ const projectRoot = path.normalize(process.cwd());
+ res.setHeader('X-React-Native-Project-Root', projectRoot);
res.end('packager-status:running');
}
|
szymonrybczak please help me, I don't understand where to insert this diff, and I'm sorry that I didn't notice what you wrote |
@m1duza to check if the diff is working you can achieve it by replacing content of
and then you need to start the dev server again with |
I have the same error as you. Have you fixed it yet? |
Has anyone solved the error? I have the same problem. |
There hasn't been any activity on this issue in the past 3 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. |
Ask your Question
after running nfs run android, the following TypeError error appears: Invalid character in header content ["X-React-Native-Project-Root"]
at Server Response.setHeader (node:_http_outgoing:662:3)
at status Page Middleware (D:\учеба4\xuysic\node_modules@react-native-community\cli-server-api\build\statusPageMiddleware .js:19:7)
at call (D:\учеба4\xuysic\node_modules\connect\index .js:239:7)
at next (D:\study4\xuysic\node_modules\connect\index.js:183:5)
at next (D:\study4\xuysic\node_modules\connect\index.js:161:14)
at next (D:\study4\xuysic\node_modules\connect\index.js:161:14)
at next (D:\study4\xuysic\node_modules\connect\index.js:161:14)
at next (D:\study4\xuysic\node_modules\connect\index.js:161:14)
at nocache (D:\учеба4\xuysic\node_modules\nocache\index .js:11:5)
at call (D:\учеба4\xuysic\node_modules\connect\index .js:239:7)
although there is not one mistake here
The text was updated successfully, but these errors were encountered: