https://discord.cloudflare.com logo
Join Discord
Powered by
# workers-discussions
  • n

    nora

    05/26/2023, 10:58 AM
    what url are you accessing, what is the logs saying/what is the strange errors? https://developers.cloudflare.com/workers/learning/logging-workers/
  • r

    REISUB

    05/26/2023, 10:59 AM
    Can I simply add the cf-related package into my existing project?
  • b

    BenParr

    05/26/2023, 11:00 AM
    so literally just // as the route then doing
    return fetch(request)
    and I was just logging the url which looked to be okay.
  • n

    nora

    05/26/2023, 11:02 AM
    sorry, what's the issue/error then?
  • b

    BenParr

    05/26/2023, 11:02 AM

    https://cdn.discordapp.com/attachments/779390076219686943/1111610301914292254/image.png▾

  • n

    nora

    05/26/2023, 11:02 AM
    what framework is that?
  • n

    nora

    05/26/2023, 11:02 AM
    next.js?
  • b

    BenParr

    05/26/2023, 11:03 AM
    passing through to nextjs yes
  • n

    nora

    05/26/2023, 11:03 AM
    what is the client error? CTRL + SHIFT + i (or F12) and then Console tab
  • b

    BenParr

    05/26/2023, 11:03 AM
    TypeError: Failed to construct 'URL': Invalid URL
  • b

    BenParr

    05/26/2023, 11:04 AM
    trying to build the worker as reverse proxy
  • b

    BenParr

    05/26/2023, 11:04 AM
    the route is fine if I access next site directly
  • p

    phonique

    05/26/2023, 11:05 AM
    Why are my images not showing when I deploy to Cloudflare? My images are fine when I deploy to Vercel...
  • w

    Walshy | Pages

    05/26/2023, 11:15 AM
    You should be good now 🙂
  • b

    Better James

    05/26/2023, 11:15 AM
    Hey there, are you using Next.js by any chance?
  • s

    sirupsen

    05/26/2023, 11:23 AM
    If you're using service calls in workers, does this effectively grant you multi-threading, or do they still end up running in the same thread/event loop? https://blog.cloudflare.com/introducing-worker-services/
  • m

    Murder Chicken

    05/26/2023, 11:24 AM
    Is there a good simple log aggregation tool that's good for workers... the over complexity of tools like NR and Splunk these days is just ... they're like the Atlassian of logging now. Anything out there with a free tier that just, you know, aggregates logs and maybe has a good interface?
  • k

    kian

    05/26/2023, 11:24 AM
    Service bindings are same isolate/thread.
  • m

    Murder Chicken

    05/26/2023, 11:25 AM
    I occurs to me there might be a better channel for this question. Let me know if I should move it.
  • s

    sirupsen

    05/26/2023, 11:27 AM
    Thought so. Too bad 🙃
  • p

    phonique

    05/26/2023, 11:38 AM
    Yes, I'm using next.js
  • b

    Better James

    05/26/2023, 11:40 AM
    So, the
    next/image
    component uses a default Image Optimization API that Vercel is intercepting the requests for for you. However, this API is not included in edge runtime builds, and therefore you need to either use normal
    img
    elements or supply a custom loader to the
    next/image
    component using something like Cloudflare Image Resizing - https://developers.cloudflare.com/images/image-resizing/integration-with-frameworks (this is an area that we're looking at improving, but at the moment, those are your options)
  • p

    phonique

    05/26/2023, 11:42 AM
    Thanks. Atleast I know now. I've been scratching my head for hours with this. so custom loader you mean
    Copy code
    const customLoader = ({ src, width, quality }) => {
      return `https://s3.amazonaws.com/demo/image/${src}?w=${width}&q=${quality || 75}
    }
  • b

    Better James

    05/26/2023, 11:43 AM
    Yeah, something like that.
  • p

    phonique

    05/26/2023, 11:43 AM
    Thanks!
  • p

    phonique

    05/26/2023, 11:52 AM
    Another quick Q can I use lazy load from lazy loader package?
  • b

    Better James

    05/26/2023, 11:53 AM
    I've not tried that out personally so I'm not sure. Feel free to give it a go though - I'd be interested to hear how it goes 🙂
  • s

    semicolondev

    05/26/2023, 12:05 PM
    How do I not acknowledge a message in CF Queues? Should I just throw an error? Context: The producer starts a job and send the job id in the queue, the job usually takes 15s-20s to complete but so the the consumer time is set to check every 15s. Now the consumer should check if the job is completed, if so then do some operation (save to db) etc and the job id should get removed But if the job isn't completed then it the Id should stay in the queue for the next 15s to get picked by another worker.
  • s

    semicolondev

    05/26/2023, 12:11 PM
    Nevermind. There's a
    ack
    method on the
    message
    https://blog.cloudflare.com/messages-at-your-speed-with-concurrency-and-explicit-acknowledgement/
  • n

    nuno

    05/26/2023, 12:40 PM
    Hey guys, the command
    wrangler secret:bulk
    still exists?
    Copy code
    ts
    npx wrangler secret:bulk .\secrets.json --env jwt
    
    X [ERROR] Unknown arguments: env, secret:bulk, .\secrets.json
1...249724982499...2509Latest