ciscoheat / sveltekit-superforms

Making SvelteKit forms a pleasure to use!
https://superforms.rocks
MIT License
2.14k stars 64 forks source link

Cannot deploy to Cloudflare because of crypto #25

Closed stefandevo closed 1 year ago

stefandevo commented 1 year ago

hi,

I am deploying my sveltekit app to Cloudflare Pages. However, when I use your library I get error on the crypto module. (I think from there https://github.com/ciscoheat/sveltekit-superforms/blob/0884bf305e20fe0a4ca2d8e02bdd731ed81bf39c/src/lib/server/entity.ts#L2)

I get this build error through GitHub actions:

Using @sveltejs/adapter-cloudflare
Error: R] Could not resolve "crypto"
    .svelte-kit/output/server/entries/pages/auth/login/_page.server.ts.js:5:19:
      5 │ import crypto from "crypto";
        ╵                    ~~~~~~~~

  The package "crypto" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
error during build:
Error: Build failed with 1 error:
.svelte-kit/output/server/entries/pages/auth/login/_page.server.ts.js:5:19: ERROR: Could not resolve "crypto"
ciscoheat commented 1 year ago

I see, it's not an important dependency, so I will find a way around it and will remove it for the next release.

ciscoheat commented 1 year ago

It's gone now, in 0.5.22! Thanks for helping out. :)