https://discord.cloudflare.com logo
Join Discord
Powered by
# miniflare
  • s

    Skye

    05/13/2023, 8:11 AM
    You could use ?
  • s

    Skye

    05/13/2023, 8:11 AM
    Though if your concern is people publishing the worker, miniflare doesn't do that
  • s

    Skye

    05/13/2023, 8:11 AM
    That's wrangler
  • l

    Lookboter

    05/18/2023, 8:25 AM
    I may just be really tired today, but wasn't miniflare able to run typescript locally without a build step? May have been dreaming too.
  • s

    Skye

    05/18/2023, 10:29 AM
    I don't believe so?
  • s

    sathoro

    05/18/2023, 7:16 PM
    I ran into another thing that miniflare does not fail on but real workers do fail:
    Copy code
    js
    const myBlob = await response.blob();
    
    await env.BUCKET.put(blobId, myBlob); // must use myBlob.stream()
  • a

    admah

    05/18/2023, 7:22 PM
    Can you file this in the Miniflare repo? https://github.com/cloudflare/miniflare/issues/new
  • s

    sathoro

    05/18/2023, 7:25 PM
    done
  • r

    Rph

    05/19/2023, 9:17 PM
    Is it possible to somehow enable support for
    eval
    in miniflare?
  • r

    Rph

    05/19/2023, 9:17 PM
    Or should I just use the debugging facilities to experiment with that kind of thing (run code in debugger console)
  • c

    CSirolli

    05/22/2023, 2:57 AM
    I tried running
    wrangler pages dev
    (v3) locally with
    --local-protocol=https
    and I got a warning saying that miniflare 3 doesn't support https servers yet, so it started an http server instead. I was hoping to test a 3rd party API locally that requires requests be made over https, which is why I tried using
    --local-protocol=https
    . Any idea when this will be added?
  • s

    Skye

    05/22/2023, 7:37 AM
    I don't know of an ETA for them adding that, but in the meantime you could use a Cloudflare Tunnel to send requests directly to your machine?
  • c

    CSirolli

    05/23/2023, 4:16 PM
    I'll have to give that a try
  • m

    MrBBot

    05/24/2023, 8:42 AM
    Hey! đź‘‹ This isn't possible right now unfortunately. What's your use case?
  • r

    Rph

    05/24/2023, 8:43 AM
    I wanted to build myself something akin to a hybrid between jupyter and codepen for workers, for quickly prototyping without losing full context
  • r

    Rph

    05/24/2023, 8:44 AM
    Hot reload fulfills 85% of that need, but it loses state between reloads
  • m

    MrBBot

    05/24/2023, 8:45 AM
    Interesting... you might want to look into the Chrome DevTools protocol. Miniflare supports starting an inspector server, which you can then send WebSocket messages to for evaluating code in the Miniflare context.
  • r

    Rph

    05/24/2023, 8:46 AM
    Alright, that might actually work even better than eval since I can also insert breakpoints and replace functions. Thanks for the heads up
  • Is wrangler3 miniflare3 planning to add
    b

    Ben-xD

    05/27/2023, 6:59 AM
    Is wrangler3/miniflare3 planning to add support for breakpoints/debugging? 🙏
    a
    • 2
    • 3
  • n

    ndls

    05/27/2023, 7:12 PM
    so uhm, the documentation for miniflare on miniflare.dev is wrong
  • n

    ndls

    05/27/2023, 7:12 PM
    ``Property 'getKVNamespace' does not exist on type 'Miniflare'.``
  • n

    ndls

    05/27/2023, 7:12 PM
    https://miniflare.dev/storage/kv
  • n

    ndls

    05/27/2023, 7:13 PM
    local cloudflare development is total freaking hell ✨
  • u

    Unsmart | Tech debt

    05/27/2023, 7:38 PM
    Seems to be there 🤔 https://github.com/cloudflare/miniflare/blob/6bace6b464e1458ac3621d14d639750455299853/packages/miniflare/src/api.ts#L111
  • w

    Walshy | Pages

    05/27/2023, 7:45 PM
    in miniflare 3 it may have been removed/renamed
  • w

    Walshy | Pages

    05/27/2023, 7:45 PM
    but I'd recommend just using Wrangler, Miniflare hasn't been the recommended way to do local development/testing for a few years now
  • n

    ndls

    05/27/2023, 7:46 PM
    if only i could get sveltekit working with wrangler and local kv
  • n

    ndls

    05/27/2023, 7:47 PM
    i might just be daft, but doing local dev with cloudflare is not easy, and the documentation is in such constant shift you never know what's up
  • n

    ndls

    05/27/2023, 7:48 PM
    as of now i'm just creating a kv memory storage manually with miniflare and it works, just couldn't use the ``Miniflare`` class
  • a

    admah

    05/28/2023, 9:21 PM
    PM for Workers here đź‘‹ Thanks for the feedback. Updating and enhancing local documentation is in the works. Hopefully consolidating everything with Wrangler will reduce the need to figure out questions like - is this Miniflare or Wrangler. Sorry for the problems so far though. If I can help at all feel free to ping me directly. Also, we are aware of the sveltekit issue and are talking through solutions there.