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

    Isaac McFadyen | YYZ01

    03/13/2022, 7:55 PM
    Try building first, then using
    wrangler pages dev
    . So run a
    svelte-kit build
    which is usually the
    npm run build
    command, then do a
    wrangler pages dev ./svelte-kit/cloudflare
  • i

    Isaac McFadyen | YYZ01

    03/13/2022, 7:55 PM
    (You'll need to have
    wrangler2
    installed for that to work though)
  • i

    Isaac McFadyen | YYZ01

    03/13/2022, 7:55 PM
    https://github.com/cloudflare/wrangler2
  • b

    balage

    03/13/2022, 7:56 PM
    I'm using workers sites, not pages (because pages functions have a request limit)
  • i

    Isaac McFadyen | YYZ01

    03/13/2022, 7:57 PM
    Oh, OK. So then you'll need to run a build and do
    wrangler dev ./build/_worker.js
    where the last part is the filepath to your built worker.
  • b

    balage

    03/13/2022, 7:58 PM
    alright, I'll try that. thank you!
  • b

    balage

    03/13/2022, 8:04 PM
    I got this error when I tried to run it
  • i

    Isaac McFadyen | YYZ01

    03/13/2022, 8:04 PM
    Hmmm.... interesting.
  • i

    Isaac McFadyen | YYZ01

    03/13/2022, 8:05 PM
    What version of
    wrangler
    ? Also, we should probably move this to #799437470004412476
  • w

    Walshy | Pages

    03/13/2022, 8:06 PM
    by the way, you can request a raise on this before we go GA. You can request that here: https://docs.google.com/forms/d/e/1FAIpQLSe4N0BjIxu9AuissCAtYjXUovViXmdx2zopjzASaJi_SImJsw/viewform?usp=send_form
  • b

    balage

    03/13/2022, 9:51 PM
    okay, I moved my stuff back to Pages, and tried to run this command using wrangler2, but I got this error
  • i

    Isaac McFadyen | YYZ01

    03/13/2022, 9:56 PM
    Check your Wrangler version, that was fixed in
    wrangler@alpha
  • b

    balage

    03/13/2022, 9:57 PM
    0.0.19
  • i

    Isaac McFadyen | YYZ01

    03/13/2022, 10:04 PM
    Hmm, interesting. Can you send the output of
    ls ./svelte-kit/cloudflare
    ?
  • i

    Isaac McFadyen | YYZ01

    03/13/2022, 10:04 PM
    (Also try
    npx wrangler@alpha pages dev ./svelte-kit/cloudflare
    )
  • b

    balage

    03/13/2022, 10:04 PM
    this one threw the same error
  • b

    balage

    03/13/2022, 10:05 PM
  • i

    Isaac McFadyen | YYZ01

    03/13/2022, 10:09 PM
    Hmm... so the _worker.js is visible there, interesting.
  • b

    balage

    03/13/2022, 10:13 PM
    I have an issue with this package btw: "@sveltejs/adapter-cloudflare"
  • b

    balage

    03/13/2022, 10:13 PM
    with the latest version: 1.0.0-next.15
  • b

    balage

    03/13/2022, 10:13 PM
    I had to revert to 1.0.0-next.14
  • b

    balage

    03/13/2022, 10:14 PM
    because I was getting this error
  • b

    balage

    03/13/2022, 10:16 PM
    in the changelog I found this
  • b

    balage

    03/13/2022, 10:17 PM
    not sure if this is related to the "No functions. Shimming..." error
  • b

    balage

    03/13/2022, 10:40 PM
    But back to the original problem, wouldn't it be possible to use these runtime api's without running build? in the dev server
  • i

    Isaac McFadyen | YYZ01

    03/13/2022, 10:41 PM
    No, because SvelteKit by default doesn't have WebCrypto.
  • i

    Isaac McFadyen | YYZ01

    03/13/2022, 10:41 PM
    When you run
    svelte-kit dev
    it runs the built-in server, which doesn't provide worker-specific functionality (it mimics Node.JS).
  • i

    Isaac McFadyen | YYZ01

    03/13/2022, 10:42 PM
    Nah, that shouldn't be.
  • b

    balage

    03/13/2022, 10:42 PM
    maybe I should install some sort of package like WebCrypto and exclude it from production?
  • i

    Isaac McFadyen | YYZ01

    03/13/2022, 10:57 PM
    Yeah, that could work.
1...939495...392Latest