Skip to content

Immutable Headers Issue in Cloudflare Workers with Remix and Hono #294

@damonpetta

Description

@damonpetta

Issue Description

When running a Remix application with Hono and Cloudflare Workers, an error occurs when modifying headers.

Environment

  • Wrangler: v3.84.1
  • @remix-run/cloudflare: 2.13.1
  • @remix-run/react: 2.13.1
  • hono: 4.6.8
  • remix-hono: 0.0.16

Steps to Reproduce

  1. Set up a Remix project with Hono and Cloudflare Workers
  2. Implement static asset handling using the staticAssets function
  3. Run the application using Wrangler

Error Message

TypeError: Can't modify immutable headers.

Root Cause

The error occurs because the staticAssets middleware attempts to modify the if-none-match header directly on the immutable Request object. In newer versions of the runtime or dependencies, this operation is not allowed on immutable headers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions