https://discord.cloudflare.com logo
Join Discord
Powered by
# functions
  • h

    HardAtWork

    11/19/2022, 10:29 AM
    Might be because you set secure to true, but then provide an http URL?
  • s

    Skye

    11/19/2022, 10:53 AM
    This command means you're telling pages dev to proxy requests to port 8787, then your server seems to be listening on port 4201? that doesn't make much sense to me
  • b

    ben20-1

    11/19/2022, 10:59 AM
    yes this is why I changed the command to wrangler pages dev -- nx serve visa-shop --port 4201
  • b

    ben20-1

    11/19/2022, 10:59 AM
    then proxy json file takes care of redirecting to correct port when routing to /api
  • s

    Skye

    11/19/2022, 11:00 AM
    it looks like the proxy is trying to route to :8787 but nothing is listening on that port
  • s

    Skye

    11/19/2022, 11:01 AM
    Which is an error from your proxy file - not wrangler
  • b

    ben20-1

    11/19/2022, 11:01 AM
    it does else it wouldnt say error while proxying your request no ?
  • s

    Skye

    11/19/2022, 11:01 AM
    Look at the last line of the error
  • s

    Skye

    11/19/2022, 11:01 AM
    that message is from your nx serve command
  • s

    Skye

    11/19/2022, 11:02 AM
    Which is failing, so then passes the error through to wrangler
  • s

    Skye

    11/19/2022, 11:02 AM
    you could see this by just going to port 4201 and getting the error directly
  • b

    ben20-1

    11/19/2022, 11:02 AM
  • b

    ben20-1

    11/19/2022, 11:02 AM
  • s

    Skye

    11/19/2022, 11:03 AM
    Regardless - this is an error from your application, not wrangler
  • b

    ben20-1

    11/19/2022, 11:06 AM
    just want to make sure of something function running on port 8787 right in dev mode ?
  • b

    ben20-1

    11/19/2022, 11:06 AM
    so why when I open the browser it opens on 8788 , 8788 is the ui port in dev mode when using pages dev ?
  • s

    Skye

    11/19/2022, 11:09 AM
    I'm pretty sure pages is :8788 whereas regular workers are :8787
  • b

    ben20-1

    11/19/2022, 11:18 AM
    @Skye that makes sense i was using wrangler port instead of pages thanks but still now getting another error
  • b

    ben20-1

    11/19/2022, 11:18 AM
  • b

    ben20-1

    11/19/2022, 11:18 AM
    GET /api/hono 500 Internal Server Error (93.87ms) GET /api/hono 500 Internal Server Error (99.43ms) GET /api/hono 500 Internal Server Error (110.26ms)
  • b

    ben20-1

    11/19/2022, 11:18 AM
    i dont see how my function is recursive
  • s

    Skye

    11/19/2022, 11:24 AM
    What's the code for your function?
  • b

    ben20-1

    11/19/2022, 11:24 AM
    Copy code
    // Next.js Edge API Routes: https://nextjs.org/docs/api-routes/edge-api-routes
    
    import type { NextRequest } from 'next/server'
    
    export default async function (req: NextRequest) {
      // const text = await req.text()
    
      return new Response(
        JSON.stringify({ name: 'John Doe' }),
        {
          status: 200,
          headers: {
            'Content-Type': 'application/json'
          }
        }
      )
    }
  • b

    ben20-1

    11/19/2022, 11:34 AM
    is it related to this issue ?
  • b

    ben20-1

    11/19/2022, 11:34 AM
    https://github.com/cloudflare/wrangler2/pull/1616
  • b

    ben20-1

    11/19/2022, 11:34 AM
    @Skye because I also get spammed by this error msg
  • b

    ben20-1

    11/19/2022, 11:34 AM
    on websocket
  • b

    ben20-1

    11/19/2022, 11:35 AM
    and i am on wrangler 2.4.0
  • b

    ben20-1

    11/19/2022, 11:35 AM
    might want to reopen this
  • s

    Skye

    11/19/2022, 11:38 AM
    I'm not sure how well wrangler functions with next
1...305306307...392Latest