From d78a09df9129c6e07c23a41abcd57717f9e644fc Mon Sep 17 00:00:00 2001 From: Chew Tee Ming Date: Fri, 1 Aug 2025 14:19:27 +0800 Subject: [PATCH 1/2] docs --- .../docs/25-build-and-deploy/60-adapter-cloudflare.md | 6 +++++- .../docs/25-build-and-deploy/80-adapter-netlify.md | 4 ++-- documentation/docs/25-build-and-deploy/90-adapter-vercel.md | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/documentation/docs/25-build-and-deploy/60-adapter-cloudflare.md b/documentation/docs/25-build-and-deploy/60-adapter-cloudflare.md index 0e438e5b0f12..1d5ae3974745 100644 --- a/documentation/docs/25-build-and-deploy/60-adapter-cloudflare.md +++ b/documentation/docs/25-build-and-deploy/60-adapter-cloudflare.md @@ -184,7 +184,11 @@ When deploying your application, the server generated by SvelteKit is bundled in ### Accessing the file system -You can't use `fs` in Cloudflare Workers — you must [prerender](page-options#prerender) the routes in question. +You can't use `fs` in Cloudflare Workers. + +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. + +Alternatively, you can [prerender](page-options#prerender) the routes in question. ## Migrating from Workers Sites diff --git a/documentation/docs/25-build-and-deploy/80-adapter-netlify.md b/documentation/docs/25-build-and-deploy/80-adapter-netlify.md index 75f2203df301..a9154a1ba5d9 100644 --- a/documentation/docs/25-build-and-deploy/80-adapter-netlify.md +++ b/documentation/docs/25-build-and-deploy/80-adapter-netlify.md @@ -115,8 +115,8 @@ Additionally, you can add your own Netlify functions by creating a directory for ### Accessing the file system -You can't use `fs` in edge deployments. +You can't use `fs` in edge functions. -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). +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 edge deployments by fetching the file from the deployed public assets location. Alternatively, you can [prerender](page-options#prerender) the routes in question. diff --git a/documentation/docs/25-build-and-deploy/90-adapter-vercel.md b/documentation/docs/25-build-and-deploy/90-adapter-vercel.md index 58e8079cda27..e63c97777f34 100644 --- a/documentation/docs/25-build-and-deploy/90-adapter-vercel.md +++ b/documentation/docs/25-build-and-deploy/90-adapter-vercel.md @@ -194,6 +194,6 @@ Projects created before a certain date may default to using an older Node versio You can't use `fs` in edge functions. -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). +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. Alternatively, you can [prerender](page-options#prerender) the routes in question. From f412d78a1b73d5151c60f3b46d276c09e3d078e1 Mon Sep 17 00:00:00 2001 From: Chew Tee Ming Date: Fri, 1 Aug 2025 14:22:19 +0800 Subject: [PATCH 2/2] oops this should be deployments --- documentation/docs/25-build-and-deploy/80-adapter-netlify.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documentation/docs/25-build-and-deploy/80-adapter-netlify.md b/documentation/docs/25-build-and-deploy/80-adapter-netlify.md index a9154a1ba5d9..32a04c335da8 100644 --- a/documentation/docs/25-build-and-deploy/80-adapter-netlify.md +++ b/documentation/docs/25-build-and-deploy/80-adapter-netlify.md @@ -115,8 +115,8 @@ Additionally, you can add your own Netlify functions by creating a directory for ### Accessing the file system -You can't use `fs` in edge functions. +You can't use `fs` in edge deployments. -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 edge deployments by fetching the file from the deployed public assets location. +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. Alternatively, you can [prerender](page-options#prerender) the routes in question.