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

    nora

    05/19/2023, 6:10 PM
    https://developers.cloudflare.com/workers/learning/using-websockets/
  • c

    Colin

    05/19/2023, 6:10 PM
    unfortunately no, I did mean just bare TCP
  • n

    nora

    05/19/2023, 6:10 PM
    Ah okay
  • c

    Colin

    05/19/2023, 6:10 PM
    websockets would be much easier 😅
  • j

    James

    05/19/2023, 6:13 PM
    Yeah inbound TCP isn't a thing yet, but something we'll likely see in future. No ETA I'm aware of.
  • a

    attfarhan

    05/19/2023, 6:14 PM
    Hey all, I've been running into an issue where a specific subset of requests to my worker are canceled.It only occurs on one code path, after all other conditions have been ruled out, which simply forwards users on to their original request with code similar to the following:
    Copy code
    let resp = await fetch(request)
    resp = new Response(resp.body, resp)
    resp.headers.append("Set-Cookie", newCookie) // only if they have no cookie yet
    return resp
    Does anyone have ideas on how to debug this, or common things to look out for when requests get canceled? I have more details here in case more info is needed: https://discord.com/channels/595317990191398933/1109019842306134086/1109019842306134086,
  • c

    Colin

    05/19/2023, 6:20 PM
    do you know if anyone's been admitted to the private beta / etc? I've asked our account manager but figured the Discord might know quicker
  • j

    James

    05/19/2023, 6:20 PM
    I don't think it even exists yet, frankly
  • c

    Colin

    05/19/2023, 6:20 PM
    well that would definitely prevent anyone from being in the beta wouldn't it 😆
  • c

    Colin

    05/19/2023, 6:21 PM
    i was reading workerd code and couldn't find any references so i was kinda thinking that
  • s

    super_pispis

    05/19/2023, 9:27 PM
    I'm trying to import a node.js module that is scoped (using @, like
    @subsquid/ss58-codec
    ), however wrangler build fails and intellisense is obviously complaining. Does the
    node:
    prefix for imports not work for scoped packages?
  • s

    Skye

    05/19/2023, 9:29 PM
    If it's a regular npm package, you shouldn't be using the
    node:
    prefix
  • s

    Skye

    05/19/2023, 9:29 PM
    that's for nodejs modules, like
    path
    , and
    buffer
  • s

    super_pispis

    05/19/2023, 9:30 PM
    Oh I see, I'm misunderstanding this line from the docs: "this prefix must be used when importing modules, both in your code and the npm packages you depend on" - I took it to mean that I could import npm-installed packages using that prefix.
  • s

    super_pispis

    05/19/2023, 9:30 PM
    Thanks
  • s

    Skye

    05/19/2023, 9:30 PM
    No, regular npm modules just use their name 😅
  • s

    super_pispis

    05/19/2023, 9:30 PM
    node_compat works though, but there's a scary part about big trade-offs
  • s

    Skye

    05/19/2023, 9:31 PM
    node_compat accepts that? That's.. weird
  • s

    super_pispis

    05/19/2023, 9:31 PM
    No, sorry, it just accepts the node module without complaining about
    assert
    in this case
  • s

    Skye

    05/19/2023, 9:32 PM
    node:assert is an allowed module with the
    nodejs_compat
    compatibility flag!
  • s

    Skye

    05/19/2023, 9:32 PM
    All of these are the ones you'd prefix with
    node:
    https://developers.cloudflare.com/workers/runtime-apis/nodejs/
  • s

    Skye

    05/19/2023, 9:33 PM
    The wording for > and the npm packages you depend on. means that the npm packages you use, must import
    node:buffer
    , for example, instead of just
    buffer
  • s

    super_pispis

    05/19/2023, 9:34 PM
    The npm library needs to use
    node:
    even with the
    nodejs_compat
    flag?
  • s

    Skye

    05/19/2023, 9:35 PM
    Yes
  • s

    Skye

    05/19/2023, 9:35 PM
    It's been a common practice (not specific to workers) for quite a while now, so most of the newer packages should already do that
  • s

    Skye

    05/19/2023, 9:36 PM
    All the node docs for any version greater than 14.x if my memory serves me correctly demonstrate importing
    node:package
    , for example
  • s

    super_pispis

    05/19/2023, 9:37 PM
    Got it, thanks for clearing that up!
  • s

    super_pispis

    05/19/2023, 9:38 PM
    Unfortunately this library doesn't use it. I can use a fatter non-node library or this one with polyfill. Or just update it and submit a PR
  • s

    Skye

    05/19/2023, 9:39 PM
    Yeah a PR or fork could easily do 🙂
  • c

    chocolatkey

    05/19/2023, 9:39 PM
    I noticed that, sort of stealthily, better 25519 curve support was added to the crypto APIs in workers. Is there any estimate on when the related page in the docs will be updated? I can follow the spec it's based off of, but would be nice to have it there too for quick reference and to confirm if there's anything missing from the spec implementation
1...248224832484...2509Latest