Skip to content

getResponseStatusText is not defined after upgrading @nuxt/scripts to rc.7 #706

@yanuaraditia

Description

@yanuaraditia

📚 What are you trying to do?

After upgrading @nuxt/scripts from rc.4 to rc.7, the deployment fails during the generate step with a ReferenceError: getResponseStatusText is not defined error.

The error occurs inside the prerenderer initialization, even though the app is configured with ssr: false (fully client-side).

Steps to Reproduce

  1. Set ssr: false in nuxt.config.ts
  2. Upgrade @nuxt/scripts from rc.4 to rc.7
  3. Run bun run generate (or equivalent)
  4. Observe the build failure

Error Output

WARN  "appendCorsHeaders", "appendCorsPreflightHeaders", ..., (truncated)

ERROR  getResponseStatusText is not defined

    at node_modules/.cache/nuxt/.nuxt/prerender/chunks/nitro/nitro.mjs:1550:3
    at moduleEvaluation (native:1:11)
    at moduleEvaluation (native:1:11)
    at requestImportModule (native:2)
    at processTicksAndRejections (native:7:39)

error: script "generate" exited with code 1
ERROR: process "/bin/sh -c bun i && bun run generate" did not complete successfully: exit code: 1

Environment

  • Package: @nuxt/scripts
  • Broken version: rc.7
  • Working version: rc.4
  • SSR: false (fully client-side app)
  • Package manager: Bun

Additional Context

The warning before the error lists a large number of h3 utility functions (e.g. appendCorsHeaders, getCookie, getRouterParams, etc.) that appear to be unresolved or improperly imported, which may be related to the root cause. getResponseStatusText seems to have been removed or renamed in a recent version of h3 / Nitro but is still being referenced internally.

Possible Cause

This may be a compatibility issue between @nuxt/scripts rc.7 and the version of h3/Nitro it depends on, where getResponseStatusText is no longer exported.

Workaround: Pinning back to rc.4 resolves the issue.

🔍 What have you tried?

I cleared the Nuxt cache at node_modules/.cache/nuxt and re-ran bun run generate, but the error persisted. I also searched for existing issues mentioning getResponseStatusText but found none. Pinning back to rc.4 confirmed it works, so the issue is isolated to rc.7.

ℹ️ Additional context

This issue only occurs during a Docker build (bun i && bun run generate). Running the same generate command locally works without any errors. The Docker build environment may be resolving different dependency versions or lacking cache that causes @nuxt/scripts rc.7 to behave differently.

FROM oven/bun:latest AS builder
WORKDIR /app
COPY . .

# Building process
RUN bun i && bun run generate

# STEP 2
FROM nginx

WORKDIR /usr/share/nginx/html
RUN  mkdir /usr/share/nginx/html/.well-known
COPY --from=builder /app/dist .
COPY --from=builder /app/deployment/nginx/nginx.conf /etc/nginx/nginx.conf
COPY --from=builder /app/deployment/nginx/prd.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/deployment/.well-known /usr/share/nginx/html/.well-known/

RUN printf '%s\n' \
  'map "" $app_name {' \
  '    default "app-home";' \
  '}' > /etc/nginx/app_name.conf

ENTRYPOINT ["nginx", "-g", "daemon off;"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions