Skip to content

Using middleware with compress: false will result in empty page #50320

@ITJesse

Description

@ITJesse

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
      Platform: linux
      Arch: x64
      Version: #22 SMP Tue Jan 10 18:39:00 UTC 2023
    Binaries:
      Node: 18.14.2
      npm: 9.5.0
      Yarn: 1.22.19
      pnpm: N/A
    Relevant packages:
      next: 13.4.4-canary.10
      eslint-config-next: 13.4.1
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.0.4

Which area(s) of Next.js are affected? (leave empty if unsure)

Middleware / Edge (API routes, runtime)

Link to the code that reproduces this issue or a replay of the bug

https://codesandbox.io/p/sandbox/festive-hamilton-7h1m0x

To Reproduce

  1. Set compress: false in next.config.js file.
  2. Create a middleware.js in the root of the project. You can simply export an empty middleware function without implementing any functionality.
  3. Start the dev server, and navigate to any of your page, it will become empty.
  4. Removing either 1 or 2 will restore normal function.

Describe the Bug

Using middleware with compress: false will result in empty page

Expected Behavior

Output normal page.

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    RuntimeRelated to Node.js or Edge Runtime with Next.js.bugIssue was opened via the bug report template.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions