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

    HardAtWork

    03/11/2023, 11:36 PM
    Run it on Vite first, with dummy data. Build for production, remove the dummy data, merge with your Worker
  • j

    johtso

    03/11/2023, 11:37 PM
    I love the sound of that, just need to figure out what's involved. So far I'm not using any cloudflare services.. but it's not obvious how to get a remix.run project that targets cloudflare running in a node environment
  • j

    johtso

    03/11/2023, 11:43 PM
    @HardAtWork I guess I could probably do a vite string replacement for
    @remix-run/cloudflare
  • j

    johtso

    03/11/2023, 11:43 PM
    that would get me close
  • j

    johtso

    03/11/2023, 11:45 PM
    not sure what I would do about cloudflare only stuff like KV backed session store, I would somehow need to avoid importing it when building in vite and use cookies as a fallback
  • j

    johtso

    03/11/2023, 11:45 PM
    maybe importing it wont cause issues and I can just do an
    if
    ..
  • a

    Advany

    03/12/2023, 6:06 AM
    I know. That why I like an outbound spam filter
  • a

    Advany

    03/12/2023, 7:13 AM
    I just had email contact with them. They told me (I am adding this for others) that they will send a bounce email to the sender if they bounce the email. Also I was able to send the Return-Path and I think they respect that. I also got an error on the api when the message was rejected. For me it seems to work!
  • p

    Ponjimon

    03/12/2023, 11:56 AM
    What would be the best way to achieve this? A worker where people can connect to using WebSockets. I'm using Durable Objects for that and it does work. The WebSocket "server" then needs to fetch another (external) API periodically and then broadcasts it to all connected users. The issue is, that those fetches count towards the subrequest limit so eventually the worker dies. Which is not what I want in a WS environment. Is this just something I cannot do with CF Workers or is there another way?
  • h

    HardAtWork

    03/12/2023, 11:58 AM
    Do the fetch in the Durable Object instead?
  • p

    Ponjimon

    03/12/2023, 12:04 PM
    I am already doing it there
  • p

    Ponjimon

    03/12/2023, 12:04 PM
    Not sure if it's just a limitation of Miniflare since I got the subrequest warning locally
  • h

    HardAtWork

    03/12/2023, 12:04 PM
    If you use Alarms, it should refresh your subrequest limit.
  • p

    Ponjimon

    03/12/2023, 12:05 PM
    I am using alarms, still got that warning 😄 I'm fairly new to Durable Objects, so maybe I'm just doing something wrong
  • h

    HardAtWork

    03/12/2023, 12:06 PM
    Not 100% sure, but that seems like a Miniflare issue...
  • p

    Ponjimon

    03/12/2023, 12:06 PM
    So, if I deploy it to Workers, it should run without any issues? There probably still are limits, or not?
  • h

    HardAtWork

    03/12/2023, 12:07 PM
    For DOs, I believe the limit is 1k subrequests per invocation, which should refresh on an Alarm trigger, afaik
  • p

    Ponjimon

    03/12/2023, 12:09 PM
    Okay, quickly reading into alarms, it seems like that's what I want to use, let's see if I can make it work. Thanks! 😄
  • u

    Up

    03/12/2023, 12:10 PM
    hello o/ is there any way to make wrangler work with a workerd instance that's hosted in a docker container?
  • d

    dave

    03/12/2023, 12:51 PM
    Careful, I think you end with duplicate headers
  • a

    Advany

    03/12/2023, 12:53 PM
    No. It overwrites the return path. I checked. Also bounces works. Just need to make a mail parser for the bounce emails
  • d

    dave

    03/12/2023, 3:28 PM
    hmm weird, I wonder which header it was that I could duplicate..
  • a

    Advany

    03/12/2023, 3:33 PM
    There are a couple that are not allowed or maybe it was a bug
  • p

    PaganMuffin

    03/12/2023, 4:31 PM
    If I have a cron worker on cron.worker.dev and I want to fetch another worker from it for example fetch.worker.dev it would fail since they are on the same zone worker.dev, right? But if fetch.worker.dev would be fetch.tld it would work? I can't use service binding because it need sometime fetch website that isn't worker
  • u

    .4li

    03/12/2023, 6:38 PM
    Hi. I'm trying to use KV through dashboard. I've added a namespace and bound that to a worker settings variable. But when I try to reference it in the editor, it says it is not defined. I'm attaching screenshots
  • j

    James

    03/12/2023, 6:44 PM
    Are you using the Module Worker format? (
    export default ...
    )
  • j

    James

    03/12/2023, 6:44 PM
    If so, it'll be available in
    env
    (second argument to your
    fetch
    method, and not as a global.
  • u

    .4li

    03/12/2023, 7:16 PM
    Thanks, that was it. Is this documented somewhere? Looks tricky to me
  • j

    James

    03/12/2023, 7:16 PM
    https://developers.cloudflare.com/workers/learning/migrating-to-module-workers/ and https://developers.cloudflare.com/workers/runtime-apis/kv/#kv-bindings mention it
  • w

    wot

    03/12/2023, 7:18 PM
    Hey, is it possible to schedule worker programmatically from another worker? I can only find examples using wrangler. EDIT: looks like durable object alarms is what I need.
1...233923402341...2509Latest