📚 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
- Set
ssr: false in nuxt.config.ts
- Upgrade
@nuxt/scripts from rc.4 to rc.7
- Run
bun run generate (or equivalent)
- 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;"]
📚 What are you trying to do?
After upgrading
@nuxt/scriptsfromrc.4torc.7, the deployment fails during thegeneratestep with aReferenceError: getResponseStatusText is not definederror.The error occurs inside the prerenderer initialization, even though the app is configured with
ssr: false(fully client-side).Steps to Reproduce
ssr: falseinnuxt.config.ts@nuxt/scriptsfromrc.4torc.7bun run generate(or equivalent)Error Output
Environment
@nuxt/scriptsrc.7rc.4false(fully client-side app)Additional Context
The warning before the error lists a large number of
h3utility functions (e.g.appendCorsHeaders,getCookie,getRouterParams, etc.) that appear to be unresolved or improperly imported, which may be related to the root cause.getResponseStatusTextseems to have been removed or renamed in a recent version ofh3/ Nitro but is still being referenced internally.Possible Cause
This may be a compatibility issue between
@nuxt/scripts rc.7and the version ofh3/Nitro it depends on, wheregetResponseStatusTextis no longer exported.Workaround: Pinning back to
rc.4resolves 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.