Skip to content

Match subrequest handling for edge and node #77477

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

Merged
merged 1 commit into from
Mar 24, 2025

Conversation

ijjk
Copy link
Member

@ijjk ijjk commented Mar 24, 2025

Backports #77474 to v13

@ijjk ijjk merged commit 1c2249d into next-13 Mar 24, 2025
34 of 55 checks passed
@ijjk ijjk deleted the ijjk/v13-remove-subrequest-handling branch March 24, 2025 21:53
@rmartins0
Copy link

rmartins0 commented Mar 25, 2025

@ijjk was there a breaking change from 13.5.8/13.5.9 to 13.5.10? cc @ztanner @huozhi @feedthejim

v13.5.9...v13.5.10

My project depends on next: ^13.5.8 and my CI/CD started failing with:

#14 9.071    Creating an optimized production build ...
#14 9.396 error Command failed with signal "SIGBUS".

Upon investigation I saw that it only happens in 13.5.10, since the caret allowed for any patch/minor version of the major 13.
I found it odd since patch versions shouldn't have a breaking change.

@ijjk
Copy link
Member Author

ijjk commented Mar 25, 2025

Hi, could you share the platform you're building on and your next info output?

@rmartins0
Copy link

rmartins0 commented Mar 25, 2025

@ijjk using Docker. Unfortunately the next info command fails due to SIGBUS. See output below. I also included an open source repository that reproduces the problem from a generated boilerplate app.

Output

# Dockerfile steps: (image: node:21-alpine)
WORKDIR /abc
RUN uname -a
Linux buildkitsandbox 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 Linux
# yarn.lock file

[email protected]:
  version "13.5.10"
  resolved "https://registry.yarnpkg.com/next/-/next-13.5.10.tgz#d4487018258e37b390a5cbdaf90b375365b22e83"
  integrity sha512-O7le09N1URRINJ7DO+TIai7/asmA6YAfUddqWpio9mvO2z+RbmgcajOScO+aqLaxRqe6wxz+Bf+FJEFALpT+RQ==
  dependencies:
    "@next/env" "13.5.10"
    "@swc/helpers" "0.5.2"
    busboy "1.6.0"
    caniuse-lite "^1.0.30001406"
    postcss "8.4.31"
    styled-jsx "5.1.1"
    watchpack "2.4.0"
  optionalDependencies:
    "@next/swc-darwin-arm64" "13.5.10"
    "@next/swc-darwin-x64" "13.5.10"
    "@next/swc-linux-arm64-gnu" "13.5.10"
    "@next/swc-linux-arm64-musl" "13.5.10"
    "@next/swc-linux-x64-gnu" "13.5.10"
    "@next/swc-linux-x64-musl" "13.5.10"
    "@next/swc-win32-arm64-msvc" "13.5.10"
    "@next/swc-win32-ia32-msvc" "13.5.10"
    "@next/swc-win32-x64-msvc" "13.5.10"
RUN npx next info --verbose
- Host system information: pass
- Next.js installation: pass
- Node.js diagnostic report: pass
npm notice 
npm notice New major version of npm available! 10.5.0 -> 11.2.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v11.2.0>
npm notice Run `npm install -g [email protected]` to update!
npm notice 
npm ERR! path /abc
npm ERR! command failed
npm ERR! signal SIGBUS
npm ERR! command sh -c next info --verbose

npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2025-03-25T22_35_14_697Z-debug-0.log
executor failed running [/bin/sh -c npx next info --verbose]: exit code: 1

Reproduction in a Repository

I made a simple repository where I installed NextJS using npx create-next-app@13 command. Then I installed version 13.5.10. Then I created a Dockerfile and reproduced the issue. Please go to:

https://github.com/rmartins0/next-13-5-10-sigbus

You can clone the repository and run

# this will just run docker build .
npm run bug

Then you will get the SIGBUS issue:

npm run bug

> [email protected] bug
> docker build .

[+] Building 17.2s (9/10)                                                            docker:desktop-linux
 => [internal] load build definition from Dockerfile                                                 0.0s
 => => transferring dockerfile: 216B                                                                 0.0s
 => [internal] load metadata for docker.io/library/node:21-alpine                                    0.6s
 => [internal] load .dockerignore                                                                    0.0s
 => => transferring context: 2B                                                                      0.0s
 => [1/6] FROM docker.io/library/node:21-alpine@sha256:78c45726ea205bbe2f23889470f03b46ac988d14b6d8  0.0s
 => => resolve docker.io/library/node:21-alpine@sha256:78c45726ea205bbe2f23889470f03b46ac988d14b6d8  0.0s
 => [internal] load build context                                                                    1.8s
 => => transferring context: 2.07MB                                                                  1.8s
 => CACHED [2/6] WORKDIR /abc                                                                        0.0s
 => [3/6] COPY  . /abc                                                                               1.8s
 => [4/6] RUN npm install                                                                           10.6s
 => ERROR [5/6] RUN npx next info --verbose                                                          2.2s 
------                                                                                                    
 > [5/6] RUN npx next info --verbose:                                                                     
0.899                                                                                                     
0.899                                                                                                     
0.903 - Host system information: pass                                                                     
1.668 - Next.js installation: pass
1.670 - Node.js diagnostic report: pass
2.204 npm ERR! path /abc
2.205 npm ERR! command failed
2.206 npm ERR! signal SIGBUS
2.207 npm ERR! command sh -c next info --verbose
2.209 
2.209 npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2025-03-25T22_53_23_282Z-debug-0.log
------
Dockerfile:7
--------------------
   5 |     
   6 |     RUN npm install
   7 | >>> RUN npx next info --verbose
   8 |     RUN npx next build
   9 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c npx next info --verbose" did not complete successfully: exit code: 1

View build details: docker-desktop://dashboard/build/desktop-linux/desktop-linux/3i682cpj71silvkc14qxjlnpe

Running just npx next build:

5.488    Creating an optimized production build ...
6.263 npm ERR! path /abc
6.265 npm ERR! command failed
6.266 npm ERR! signal SIGBUS
6.266 npm ERR! command sh -c next build
6.269
6.269 npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2025-03-25T23_00_45_773Z-debug-0.log
------
Dockerfile:8
--------------------
   6 |     RUN npm install
   7 |     # RUN npx next info --verbose
   8 | >>> RUN npx next build

Other Docker images

I also tried and reproduced on images node:23-alpine, node:22-alpine.

It was not reproduced on image node:latest.

@ballmw
Copy link

ballmw commented Mar 26, 2025

Same issue here.

@iambryancs
Copy link

Same issue using Nx 16 and Node 18/20.

 => ERROR [8/8] RUN npx nx build my-next-app --skip-nx-cache                                     2.2s
------
 > [8/8] RUN npx nx build my-next-app --skip-nx-cache:
1.333
1.333  >  NX   --skip-nx-cache disables the connection to Nx Cloud for the current run.
1.333
1.333    The remote cache will not be read from or written to during this run.
1.333
1.341
1.341 > nx run my-next-app:build:production
1.341
1.968 Attention: Next.js now collects completely anonymous telemetry regarding usage.
1.968 This information is used to shape Next.js' roadmap and prioritize features.
1.968 You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
1.968 https://nextjs.org/telemetry
2.009    Creating an optimized production build ...
2.050 Error occurred while trying to run the build command
2.050 null
2.058
2.058
2.058
2.058  >  NX   Running target build for project my-next-app failed
2.058
2.058    Failed tasks:
2.058
2.058    - my-next-app:build:production
2.058
2.058    Hint: run the command with --verbose for more details.
2.058
------

Using Next 13.5.9 works but when using the latest 13.5.10 the error occurs.

@ijjk
Copy link
Member Author

ijjk commented Mar 27, 2025

Hi, we just published v13.5.11 which locked the swc binary versions to the v13.5.9 binaries as those are still valid for v13.5.11. I was able to run your repro when using that version. Please upgrade and give that a try!

@iambryancs
Copy link

Thank you @ijjk ! Tested on my nx env and @rmartins0 's repro repo and confirmed working.

❯ git remote -v                                                                                      ─╯
origin  https://github.com/rmartins0/next-13-5-10-sigbus.git (fetch)
origin  https://github.com/rmartins0/next-13-5-10-sigbus.git (push)

❯ DOCKER_BUILDKIT=0 docker build .                                                                   ─╯
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
            BuildKit is currently disabled; enable it by removing the DOCKER_BUILDKIT=0
            environment-variable.

Sending build context to Docker daemon  261.3MB
Step 1/7 : FROM node:21-alpine
21-alpine: Pulling from library/node
94747bd81234: Already exists
c6afd58f95b7: Already exists
c816472f4f4e: Already exists
0fbe816ec3aa: Already exists
Digest: sha256:78c45726ea205bbe2f23889470f03b46ac988d14b6d813d095e2e9909f586f93
Status: Downloaded newer image for node:21-alpine
 ---> c3d7eb7b3b2b
Step 2/7 : WORKDIR /abc
 ---> Running in 45dfa08c18f8
 ---> Removed intermediate container 45dfa08c18f8
 ---> f484ce4e8be5
Step 3/7 : COPY  . /abc
 ---> b0a1a1df0299
Step 4/7 : RUN npm install
 ---> Running in b9bfca9377bb

added 4 packages, and audited 308 packages in 2s

122 packages are looking for funding
  run `npm fund` for details

1 high severity vulnerability

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
npm notice
npm notice New major version of npm available! 10.5.0 -> 11.2.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v11.2.0>
npm notice Run `npm install -g [email protected]` to update!
npm notice
 ---> Removed intermediate container b9bfca9377bb
 ---> 9cab799c0f6c
Step 5/7 : RUN npx next info --verbose
 ---> Running in 6a4cd3e85f8e


- Host system information: pass
- Next.js installation: pass
- Node.js diagnostic report: pass
- next-swc installation: pass
- next-swc shared object dependencies: skipped
  This diagnostics uses system-installed tools (ldd) to check next-swc dependencies, but it is not found. Skipping dependencies check.

Generated diagnostics report

Please copy below report and paste it into your issue.

### Host system information

  WSL: false
  Docker: true
  CI: false


### Next.js installation

  Binaries:
    Node: 21.7.3
    npm: 10.5.0
    Yarn: 1.22.19
    pnpm: N/A
  Relevant Packages:
    next: 13.5.11
    eslint-config-next: 13.5.8
    react: 18.3.1
    react-dom: 18.3.1
    typescript: 5.8.2
  Next.js Config:
    output: N/A
    ...
    ...

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants