Skip to content
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

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

Open
damonpetta opened this issue Nov 1, 2024 · 0 comments
Open

Comments

@damonpetta
Copy link

damonpetta commented Nov 1, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant