hono icon indicating copy to clipboard operation
hono copied to clipboard

cf properties in request is broken

Open vickyRathee opened this issue 1 year ago • 4 comments

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

vickyRathee avatar Sep 28 '24 14:09 vickyRathee

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"],

yusukebe avatar Sep 29 '24 07:09 yusukebe

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

image

vickyRathee avatar Sep 29 '24 10:09 vickyRathee

@vickyRathee

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

yusukebe avatar Sep 29 '24 10:09 yusukebe

@yusukebe Sure, I will create one

vickyRathee avatar Sep 29 '24 11:09 vickyRathee

This issue has been marked as stale due to inactivity.

github-actions[bot] avatar Nov 03 '24 00:11 github-actions[bot]

Closing this issue due to inactivity.

github-actions[bot] avatar Nov 06 '24 00:11 github-actions[bot]