Skip to content

Commit e7cae20

Browse files
committed
[docs] add note about inability to access file system at runtime
Closes #8039
1 parent 57e8d1a commit e7cae20

File tree

5 files changed

+32
-0
lines changed

5 files changed

+32
-0
lines changed

.changeset/polite-stingrays-smell.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@sveltejs/adapter-cloudflare': patch
3+
'@sveltejs/adapter-cloudflare-workers': patch
4+
'@sveltejs/adapter-netlify': patch
5+
'@sveltejs/adapter-vercel': patch
6+
---
7+
8+
[docs] add note about inability to access file system at runtime

packages/adapter-cloudflare-workers/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ declare namespace App {
111111

112112
> `platform.env` is only available in the production build. Use [wrangler](https://developers.cloudflare.com/workers/cli-wrangler) to test it locally
113113
114+
## Troubleshooting
115+
116+
### Accessing the file system
117+
118+
You can't access the file system through methods like `fs.readFileSync` in Serverless/Edge environments. If you need to access files that way, do that during building the app through [prerendering](https://kit.svelte.dev/docs/page-options#prerender). If you have a blog for example and don't want to manage your content through a CMS, then you need to prerender the content (or prerender the endpoint from which you get it) and redeploy your blog everytime you add new content.
119+
114120
## Changelog
115121

116122
[The Changelog for this package is available on GitHub](https://github.com./sveltejs/kit/blob/master/packages/adapter-cloudflare-workers/CHANGELOG.md).

packages/adapter-cloudflare/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ The [`_headers` and `_redirects`](config files) files specific to Cloudflare Pag
8787

8888
However, they will have no effect on responses dynamically rendered by SvelteKit, which should return custom headers or redirect responses from [server endpoints](https://kit.svelte.dev/docs/routing#server) or with the [`handle`](https://kit.svelte.dev/docs/hooks#server-hooks-handle) hook.
8989

90+
## Troubleshooting
91+
92+
### Accessing the file system
93+
94+
You can't access the file system through methods like `fs.readFileSync` in Serverless/Edge environments. If you need to access files that way, do that during building the app through [prerendering](https://kit.svelte.dev/docs/page-options#prerender). If you have a blog for example and don't want to manage your content through a CMS, then you need to prerender the content (or prerender the endpoint from which you get it) and redeploy your blog everytime you add new content.
95+
9096
## Changelog
9197

9298
[The Changelog for this package is available on GitHub](https://github.com./sveltejs/kit/blob/master/packages/adapter-cloudflare/CHANGELOG.md).

packages/adapter-netlify/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ Additionally, you can add your own Netlify functions by creating a directory for
104104
directory = "functions"
105105
```
106106

107+
## Troubleshooting
108+
109+
### Accessing the file system
110+
111+
You can't access the file system through methods like `fs.readFileSync` in Serverless/Edge environments. If you need to access files that way, do that during building the app through [prerendering](https://kit.svelte.dev/docs/page-options#prerender). If you have a blog for example and don't want to manage your content through a CMS, then you need to prerender the content (or prerender the endpoint from which you get it) and redeploy your blog everytime you add new content.
112+
107113
## Changelog
108114

109115
[The Changelog for this package is available on GitHub](https://github.com./sveltejs/kit/blob/master/packages/adapter-netlify/CHANGELOG.md).

packages/adapter-vercel/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ Projects created before a certain date will default to using Node 14, while Svel
7474

7575
![Vercel project settings](settings.png)
7676

77+
## Troubleshooting
78+
79+
### Accessing the file system
80+
81+
You can't access the file system through methods like `fs.readFileSync` in Serverless/Edge environments. If you need to access files that way, do that during building the app through [prerendering](https://kit.svelte.dev/docs/page-options#prerender). If you have a blog for example and don't want to manage your content through a CMS, then you need to prerender the content (or prerender the endpoint from which you get it) and redeploy your blog everytime you add new content.
82+
7783
## Changelog
7884

7985
[The Changelog for this package is available on GitHub](https://github.com./sveltejs/kit/blob/master/packages/adapter-vercel/CHANGELOG.md).

0 commit comments

Comments
 (0)