Cloudflare DevelopersCD
Cloudflare Developers2y ago
3 replies
Robin

@auth/sveltekit! I have the same issue

@auth/sveltekit! I have the same issue on cf pages functions.

> Using @sveltejs/adapter-cloudflare
21:38:26.511    ✘ [ERROR] Could not resolve "crypto"
21:38:26.512    
21:38:26.512        .svelte-kit/output/server/chunks/hooks.server.js:4:26:
21:38:26.513          4 │ import * as crypto$1 from "crypto";
21:38:26.513            ╵                           ~~~~~~~~
21:38:26.513    
21:38:26.513      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.
21:38:26.514    
21:38:26.516    ✘ [ERROR] Could not resolve "node:buffer"
21:38:26.517    
21:38:26.517        .svelte-kit/output/server/chunks/hooks.server.js:6:23:
21:38:26.517          6 │ import { Buffer } from "node:buffer";
21:38:26.517            ╵                        ~~~~~~~~~~~~~
21:38:26.517    
21:38:26.517      The package "node:buffer" 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.
21:38:26.517    

...

21:38:26.532    error during build:
21:38:26.532    Error: Build failed with 4 errors:
21:38:26.532    .svelte-kit/output/server/chunks/hooks.server.js:4:26: ERROR: Could not resolve "crypto"
21:38:26.532    .svelte-kit/output/server/chunks/hooks.server.js:6:23: ERROR: Could not resolve "node:buffer"
21:38:26.532    .svelte-kit/output/server/chunks/hooks.server.js:7:26: ERROR: Could not resolve "node:crypto"
21:38:26.532    .svelte-kit/output/server/chunks/hooks.server.js:9:22: ERROR: Could not resolve "node:util"
Was this page helpful?