Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e647e04

Browse files
authoredMar 18, 2025··
Update adapter-cloudflare documentation
1 parent ee21412 commit e647e04

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎documentation/docs/25-build-and-deploy/60-adapter-cloudflare.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ When configuring your project settings, you must use the following settings:
6868
- **Build command**`npm run build` or `vite build`
6969
- **Build output directory**`.svelte-kit/cloudflare`
7070

71+
Once configured, go to the **Runtime** section of your project settings, and add the `nodejs_als` compability flag to enable the [Node.js AsyncLocalStorage](https://developers.cloudflare.com/workers/configuration/compatibility-flags/#nodejs-asynclocalstorage).
72+
7173
## Runtime APIs
7274

7375
The [`env`](https://developers.cloudflare.com/workers/runtime-apis/fetch-event#parameters) object contains your project's [bindings](https://developers.cloudflare.com/pages/functions/bindings/), which consist of KV/DO namespaces, etc. It is passed to SvelteKit via the `platform` property, along with [`context`](https://developers.cloudflare.com/workers/runtime-apis/context/), [`caches`](https://developers.cloudflare.com/workers/runtime-apis/cache/), and [`cf`](https://developers.cloudflare.com/workers/runtime-apis/request/#incomingrequestcfproperties), meaning that you can access it in hooks and endpoints:
@@ -105,7 +107,7 @@ export {};
105107

106108
Cloudflare Workers specific values in the `platform` property are emulated during dev and preview modes. Local [bindings](https://developers.cloudflare.com/pages/functions/bindings/) are created based on your [Wrangler configuration file](https://developers.cloudflare.com/pages/functions/wrangler-configuration/#local-development) and are used to populate `platform.env` during development and preview. Use the adapter config [`platformProxy` option](#Options-platformProxy) to change your preferences for the bindings.
107109

108-
For testing the build, you should use [Wrangler](https://developers.cloudflare.com/workers/wrangler/) **version 3**. Once you have built your site, run `wrangler pages dev .svelte-kit/cloudflare`.
110+
For testing the build, you should use [Wrangler](https://developers.cloudflare.com/workers/wrangler/) **version 3**. Once you have built your site, run `wrangler pages dev .svelte-kit/cloudflare --compatibility-flag=nodejs_als`.
109111

110112
## Notes
111113

0 commit comments

Comments
 (0)
Please sign in to comment.