honojs / hono

Web framework built on Web Standards
https://hono.dev
MIT License
18.93k stars 538 forks source link

cf properties in request is broken #3463

Open vickyRathee opened 1 day ago

vickyRathee commented 1 day ago

What version of Hono are you using?

4.6.3

What runtime/platform is your app running on?

Cloudflare pages

What steps can reproduce the bug?

The cf properties are not exported in req.raw ?

image

tsconfig.json

{
  "compilerOptions": {
    "target": "esnext",
    "module": "esnext",
    "moduleResolution": "Bundler",
    "strict": false,
    "skipLibCheck": true,
    "lib": ["esnext", "dom"],
    "types": ["@cloudflare/workers-types", "vite/client"],
    "jsx": "react-jsx",
    "jsxImportSource": "hono/jsx"
  }
}

What is the expected behavior?

The TS should not complain

What do you see instead?

TS error

Additional information

No response

yusukebe commented 1 day ago

Hi @vickyRathee

There is a conflict of definition of Response between Cloudflare's and DOM's. Remove the dom from your tsconfig.json:

"lib": ["esnext"],
vickyRathee commented 22 hours ago

@yusukebe that doesn't made any difference, still TS error. Already tried closing vscode > reopen etc.

image

yusukebe commented 22 hours ago

@vickyRathee

I can't reproduce it. Please provide a minimal project to reproduce it if you want we help you.

vickyRathee commented 22 hours ago

@yusukebe Sure, I will create one