Skip to content
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

x-forwared-for error on stackblitz #2197

Closed
samydoesit opened this issue Feb 29, 2024 · 2 comments · Fixed by #2198
Closed

x-forwared-for error on stackblitz #2197

samydoesit opened this issue Feb 29, 2024 · 2 comments · Fixed by #2198

Comments

@samydoesit
Copy link
Contributor

Environment

"nuxt": "^3.10.3",
"nitro": "2.9.0"

Reproduction

https://stackblitz.com/edit/github-jnmnbt?file=README.md

Describe the bug

A new Nuxt Starter on Stackblitz via nuxt.new leads to an error - nothing will be rendered. (undefined - x-forwared-for)

 ERROR  [uncaughtException] Invalid value "undefined" for header "x-forwarded-for"  

Downgrading nitropack to 2.8.1 fixes the issue.

Additional context

No response

Logs

ERROR  [uncaughtException] Invalid value "undefined" for header "x-forwarded-for"                        10:57:09

  at __node_internal_ (https://githubjnmnbt-om4n.w-credentialless-staticblitz.com/blitz.c9a8a620.js:36:5406)
  at new <anonymous> (https://githubjnmnbt-om4n.w-credentialless-staticblitz.com/blitz.c9a8a620.js:36:4168)
  at __node_internal_ (https://githubjnmnbt-om4n.w-credentialless-staticblitz.com/blitz.c9a8a620.js:184:8336)
  at OutgoingMessage.appendHeader (https://githubjnmnbt-om4n.w-credentialless-staticblitz.com/blitz.c9a8a620.js:184:8963)
  at ProxyServer.eval (node_modules/nitropack/dist/chunks/server.mjs:342:16)
  at EventEmitter.emit (https://githubjnmnbt-om4n.w-credentialless-staticblitz.com/blitz.c9a8a620.js:42:9202)
  at ClientRequest.eval (node_modules/httpxy/dist/index.mjs:272:16)
  at EventEmitter.emit (https://githubjnmnbt-om4n.w-credentialless-staticblitz.com/blitz.c9a8a620.js:42:9202)
  at https://githubjnmnbt-om4n.w-credentialless-staticblitz.com/blitz.c9a8a620.js:252:11492
  at onSocketNT (https://githubjnmnbt-om4n.w-credentialless-staticblitz.com/blitz.c9a8a620.js:252:11509)
@manniL
Copy link
Member

manniL commented Feb 29, 2024

@pi0 (sorry for the ping but rather urgent) - sent a PR fixing this in #2198

@pi0 pi0 changed the title Nuxt Starter - x-forwared-for error on stackblitz x-forwared-for error on stackblitz Feb 29, 2024
@pi0 pi0 closed this as completed in #2198 Feb 29, 2024
@pi0
Copy link
Member

pi0 commented Feb 29, 2024

Thanks for the report and PR. It will be fixed in a patch release however it is strange that stackblitz is not setting this field (according to the Node.js docs it shall be undefined but when socket is destroyed).

It also made issues in other places such as crossws.unjs.io when testing on stackblitz. (will relay this to the team)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants