stackblitz / webcontainer-core

Dev environments. In your web app.
https://webcontainers.io
MIT License
3.7k stars 139 forks source link

Nuxt broken #1353

Closed codeflorist closed 3 months ago

codeflorist commented 4 months ago

Describe the bug

Creating a new Nuxt project currently results in the following error:

 ERROR  [uncaughtException] Invalid value "undefined" for header "x-forwarded-for"                                                      09:21:13

  at __node_internal_ (https://nuxtstartercym5u4-wjye.w-credentialless-staticblitz.com/blitz.c9a8a620.js:36:5406)
  at new <anonymous> (https://nuxtstartercym5u4-wjye.w-credentialless-staticblitz.com/blitz.c9a8a620.js:36:4168)
  at __node_internal_ (https://nuxtstartercym5u4-wjye.w-credentialless-staticblitz.com/blitz.c9a8a620.js:184:8336)
  at OutgoingMessage.appendHeader (https://nuxtstartercym5u4-wjye.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://nuxtstartercym5u4-wjye.w-credentialless-staticblitz.com/blitz.c9a8a620.js:42:9202)
  at ClientRequest.eval (node_modules/httpxy/dist/index.mjs:272:16)
  at EventEmitter.emit (https://nuxtstartercym5u4-wjye.w-credentialless-staticblitz.com/blitz.c9a8a620.js:42:9202)
  at https://nuxtstartercym5u4-wjye.w-credentialless-staticblitz.com/blitz.c9a8a620.js:252:11492
  at onSocketNT (https://nuxtstartercym5u4-wjye.w-credentialless-staticblitz.com/blitz.c9a8a620.js:252:11509)
  at _0x271e48 (https://nuxtstartercym5u4-wjye.w-credentialless-staticblitz.com/blitz.c9a8a620.js:352:154311)
  at https://nuxtstartercym5u4-wjye.w-credentialless-staticblitz.com/blitz.c9a8a620.js:352:154068

Link to the blitz that caused the error

https://stackblitz.com/edit/nuxt-starter-cym5u4?file=README.md

Steps to reproduce

  1. Create new nuxt project
  2. Boot it up
  3. Seid error appears in terminal

Expected behavior

No error

Parity with Local

Screenshots

No response

Platform

Browser name  = Chrome
Full version  = 122.0.0.0
Major version = 122
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36
performance.memory = {
  "totalJSHeapSize": 105152415,
  "usedJSHeapSize": 88194339,
  "jsHeapSizeLimit": 4294705152
}
Hash = c9a8a620

Additional context

No response

samydoesit commented 4 months ago

This is caused by the latest nitropack update. You need to downgrade nitropack to version 2.8.1. Try the updated stackblitz: https://stackblitz.com/edit/nuxt-starter-lyev9u?file=package.json

Created an Issue on nitropack for this. https://github.com/unjs/nitro/issues/2197

manniL commented 4 months ago

Well, technically it was because stackblitz is not setting the socket.remoteAddress. We pushed a Nitro hotfix

codeflorist commented 3 months ago

It's working again. Thanks everyone!