Skip to content

Commit 6c13063

Browse files
authored
docs: mention read works in edge environments (#14085)
* docs * oops this should be deployments
1 parent e4d8002 commit 6c13063

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,11 @@ When deploying your application, the server generated by SvelteKit is bundled in
184184

185185
### Accessing the file system
186186

187-
You can't use `fs` in Cloudflare Workers — you must [prerender](page-options#prerender) the routes in question.
187+
You can't use `fs` in Cloudflare Workers.
188+
189+
Instead, use the [`read`]($app-server#read) function from `$app/server` to access your files. It works by fetching the file from the deployed public assets location.
190+
191+
Alternatively, you can [prerender](page-options#prerender) the routes in question.
188192

189193
## Migrating from Workers Sites
190194

documentation/docs/25-build-and-deploy/80-adapter-netlify.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,6 @@ Additionally, you can add your own Netlify functions by creating a directory for
117117

118118
You can't use `fs` in edge deployments.
119119

120-
You _can_ use it in serverless deployments, but it won't work as expected, since files are not copied from your project into your deployment. Instead, use the [`read`]($app-server#read) function from `$app/server` to access your files. `read` does not work inside edge deployments (this may change in future).
120+
You _can_ use it in serverless deployments, but it won't work as expected, since files are not copied from your project into your deployment. Instead, use the [`read`]($app-server#read) function from `$app/server` to access your files. It also works inside edge deployments by fetching the file from the deployed public assets location.
121121

122122
Alternatively, you can [prerender](page-options#prerender) the routes in question.

documentation/docs/25-build-and-deploy/90-adapter-vercel.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,6 @@ Projects created before a certain date may default to using an older Node versio
194194

195195
You can't use `fs` in edge functions.
196196

197-
You _can_ use it in serverless functions, but it won't work as expected, since files are not copied from your project into your deployment. Instead, use the [`read`]($app-server#read) function from `$app/server` to access your files. `read` does not work inside routes deployed as edge functions (this may change in future).
197+
You _can_ use it in serverless functions, but it won't work as expected, since files are not copied from your project into your deployment. Instead, use the [`read`]($app-server#read) function from `$app/server` to access your files. It also works inside routes deployed as edge functions by fetching the file from the deployed public assets location.
198198

199199
Alternatively, you can [prerender](page-options#prerender) the routes in question.

0 commit comments

Comments
 (0)