Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(vercel): added warning when ENABLE_FILE_SYSTEM_API=1 is missing #3139

Merged
merged 3 commits into from
Apr 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/soft-fishes-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/vercel': patch
---

Added warning when `ENABLE_FILE_SYSTEM_API` is not found
2 changes: 1 addition & 1 deletion packages/integrations/vercel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default defineConfig({
});
```

After you build your site the `.output/` folder will contain your server-side rendered app. Since this feature is still in beta, you'll **need to add this Enviroment Variable to your Vercel project**: `ENABLE_FILE_SYSTEM_API=1`
After you build your site the `.output/` folder will contain your server-side rendered app. Since this feature is still in beta, you'll **need to add this Enviroment Variable to your Vercel project**: `ENABLE_FILE_SYSTEM_API=1`. [Learn how to set enviroment variables](https://vercel.com/docs/concepts/projects/environment-variables).

Now you can deploy!

Expand Down
6 changes: 6 additions & 0 deletions packages/integrations/vercel/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ export default function vercel(): AstroIntegration {
buildConfig.serverEntry = `${ENTRYFILE}.js`;
buildConfig.client = new URL('./static/', _config.outDir);
buildConfig.server = new URL('./server/pages/', _config.outDir);

if (String(process.env.ENABLE_FILE_SYSTEM_API) !== '1') {
console.warn(
`The enviroment variable "ENABLE_FILE_SYSTEM_API" was not found. Make sure you have it set to "1" in your Vercel project.\nLearn how to set enviroment variables here: https://vercel.com/docs/concepts/projects/environment-variables`
);
}
},
'astro:build:done': async ({ routes }) => {
// Bundle dependecies
Expand Down