wevm / frog

Framework for Farcaster Frames 🐸
https://frog.fm
Other
425 stars 97 forks source link

TypeError: Failed to parse URL from ... TypeError: Invalid URL #46

Closed christopherwxyz closed 8 months ago

christopherwxyz commented 8 months ago

Describe the bug

Install Frog and Hono using latest Next.js 14 -- bun run dev runs fine without a Hub URL. However, when I provide any URL, it will fail with a type error.

Screenshot 2024-03-01 at 7 43 04 AM Screenshot 2024-03-01 at 7 43 30 AM

Link to Minimal Reproducible Example

bun run dev

Steps To Reproduce

bun run dev, navigate to http://localhost:3000/api/dev, click any button, error is thrown.

Screenshot 2024-03-01 at 7 45 25 AM

Frog Version

0.2.4

TypeScript Version

^5

Check existing issues

Anything else?

No response

christopherwxyz commented 8 months ago

Additionally providing a :2283 URL will fail as well:


cause: HTTPParserError: Response does not match the HTTP/1.1 protocol (Expected HTTP/)
      at Parser.execute (node:internal/deps/undici/undici:8593:19)
      at Parser.readMore (node:internal/deps/undici/undici:8552:16)
      at Socket.onSocketReadable (node:internal/deps/undici/undici:8866:16)
      at Socket.emit (node:events:518:28)
      at emitReadable_ (node:internal/streams/readable:832:12)
      at process.processTicksAndRejections (node:internal/process/task_queues:81:21) {
    code: 'HPE_INVALID_CONSTANT',
    data: '\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\b\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02'
  }```
Complexlity commented 8 months ago

I ran into the same issue. The reason is, by default, if you have a hubApiUrl while creating a new application, it would try to validate every request. You can make the error go way by either

  1. Removing hubApiUrl on line 9
  2. Signing your farcaster account on the dev route image
tmm commented 8 months ago

You can also set verify to false.

For more info on frame verification, see https://frog.fm/concepts/securing-frames#silent-verification